Skip to content

Commit

Permalink
[8.0.1.3.0] l10n_id_djbc_plb_common
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Jan 11, 2019
1 parent 9308475 commit 7e10ec9
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 2 deletions.
6 changes: 4 additions & 2 deletions l10n_id_djbc_plb_common/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Indonesia - Common Feature for Pusat Logistik Berikat",
"version": "8.0.1.2.0",
"version": "8.0.1.3.0",
"category": "localization",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
Expand All @@ -15,6 +15,8 @@
],
"data": [
"menu.xml",
"views/stock_picking_type_views.xml"
"views/stock_picking_type_views.xml",
"views/product_template_views.xml",
"views/product_category_views.xml",
],
}
2 changes: 2 additions & 0 deletions l10n_id_djbc_plb_common/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import stock_picking_type
from . import product_category
from . import product_template
13 changes: 13 additions & 0 deletions l10n_id_djbc_plb_common/models/product_category.py
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_plb_ok = fields.Boolean(
string="Category for DJBC PLB",
)
28 changes: 28 additions & 0 deletions l10n_id_djbc_plb_common/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- 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",
"categ_ids.djbc_plb_ok",
)
def _compute_djbc_plb_ok(self):
for template in self:
djbc_ok = False
for categ in template.categ_ids:
if categ.djbc_plb_ok:
djbc_ok = True
template.djbc_plb_ok = djbc_ok

djbc_plb_ok = fields.Boolean(
string="Can be Used for DJBC PLB",
compute="_compute_djbc_plb_ok",
store=True,
)
18 changes: 18 additions & 0 deletions l10n_id_djbc_plb_common/views/product_category_views.xml
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_plb_ok"/>
</xpath>
</field>
</record>
</data>
</openerp>
21 changes: 21 additions & 0 deletions l10n_id_djbc_plb_common/views/product_template_views.xml
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_plb_ok"/>
<label for="djbc_plb_ok"/>
</div>
</xpath>
</field>
</record>
</data>
</openerp>

0 comments on commit 7e10ec9

Please sign in to comment.