Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,10 @@ dmypy.json

# Pyre type checker
.pyre/

node_modules
.eslintignore
.eslintrc.json
jsconfig.json
package-lock.json
package.json
1 change: 1 addition & 0 deletions product_as_kit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions product_as_kit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Product as Kit",
"version": "1.0",
"depends": ["product", "sale_management"],
"author": "Shivam Saksham(shsak)",
"category": "Sales",
"description": """
An module to let the product be sold as kit.
""",
"license": "LGPL-3",
"data": [
"views/product_template_views.xml",
],
}
1 change: 1 addition & 0 deletions product_as_kit/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_template
8 changes: 8 additions & 0 deletions product_as_kit/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import fields, models


class ProductTemplate(models.Model):
_inherit = 'product.template'

isKit = fields.Boolean(default=False)
sub_products = fields.Many2many('product.product')
13 changes: 13 additions & 0 deletions product_as_kit/views/product_template_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<odoo>
<record id="product_template_form_view_kit" model="ir.ui.view">
<field name="name">product.template.form.inherit.product.as.kit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='group_general']" position="inside">
<field name="isKit" string="Is Kit"/>
<field name="sub_products" string="Sub Products" invisible="not isKit" widget="many2many_tags" />
</xpath>
</field>
</record>
</odoo>