-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.0.1.6.0] l10n_id_djbc_kb_lap_common
- Loading branch information
Showing
7 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2018 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import models, fields | ||
|
||
|
||
class ProductCategory(models.Model): | ||
_inherit = "product.category" | ||
|
||
djbc_kb_ok = fields.Boolean( | ||
string="Category for DJBC KB", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2018 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import models, fields, api | ||
|
||
|
||
class ProductTemplate(models.Model): | ||
_inherit = "product.template" | ||
|
||
@api.multi | ||
@api.depends( | ||
"categ_ids" | ||
) | ||
def _compute_djbc_ok(self): | ||
for template in self: | ||
djbc_ok = False | ||
for categ in template.categ_ids: | ||
if categ.djbc_kb_ok: | ||
djbc_ok = True | ||
template.djbc_kb_ok = djbc_ok | ||
|
||
djbc_kb_ok = fields.Boolean( | ||
string="Can be Used for DJBC KB", | ||
compute="_compute_djbc_ok", | ||
store=False, | ||
) |
18 changes: 18 additions & 0 deletions
18
l10n_id_djbc_kb_lap_common/views/product_category_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2017 OpenSynergy Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> | ||
|
||
<openerp> | ||
<data> | ||
<record id="product_category_view_form" model="ir.ui.view"> | ||
<field name="name">product.category form</field> | ||
<field name="model">product.category</field> | ||
<field name="inherit_id" ref="product.product_category_form_view"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='type']" position="after"> | ||
<field name="djbc_kb_ok"/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</data> | ||
</openerp> |
21 changes: 21 additions & 0 deletions
21
l10n_id_djbc_kb_lap_common/views/product_template_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2017 OpenSynergy Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> | ||
|
||
<openerp> | ||
<data> | ||
<record id="product_template_view_form" model="ir.ui.view"> | ||
<field name="name">product.template form</field> | ||
<field name="model">product.template</field> | ||
<field name="inherit_id" ref="product.product_template_form_view"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@name='options']" position="after"> | ||
<div> | ||
<field name="djbc_kb_ok"/> | ||
<label for="djbc_kb_ok"/> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</data> | ||
</openerp> |