Skip to content

Commit

Permalink
[8.0.1.6.0] l10n_id_djbc_kb_lap_common
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Jan 11, 2019
1 parent 7b72b7a commit fcafdc8
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 1 deletion.
4 changes: 3 additions & 1 deletion l10n_id_djbc_kb_lap_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 Kawasan Berikat Reporting",
"version": "8.0.1.5.1",
"version": "8.0.1.6.0",
"category": "localization",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
Expand All @@ -22,5 +22,7 @@
"views/stock_picking_type_views.xml",
"views/stock_inventory_views.xml",
"views/res_company_views.xml",
"views/product_category_views.xml",
"views/product_template_views.xml",
],
}
13 changes: 13 additions & 0 deletions l10n_id_djbc_kb_lap_common/data/product_category_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
<field name="name">Bahan Baku</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_bahan_penolong" model="product.category">
<field name="name">Bahan Penolong</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_barang_modal" model="product.category">
Expand All @@ -32,66 +34,77 @@
<field name="name">Peralatan Untuk Pembangunan, Perluasan, atau Konstruksi KB</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_barang_modal"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_mesin" model="product.category">
<field name="name">Mesin</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_barang_modal"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_cetakan" model="product.category">
<field name="name">Cetakan Moulding</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_barang_modal"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_sparepart" model="product.category">
<field name="name">Sparepart</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_barang_modal"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_peralatan_kantor" model="product.category">
<field name="name">Peralatan Kantor</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_barang_contoh" model="product.category">
<field name="name">Barang Contoh</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_wip" model="product.category">
<field name="name">Barang WIP</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_hasil_produksi" model="product.category">
<field name="name">Hasil Produksi</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_scrap" model="product.category">
<field name="name">Scrap/Waste</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_pengemas" model="product.category">
<field name="name">Pengemas &amp; Alat Bantu Pengemas</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>

<record id="product_categ_kb_konsumsi" model="product.category">
<field name="name">Barang Untuk Konsumsi</field>
<field name="type">view</field>
<field name="parent_id" ref="product_categ_kb_root"/>
<field name="djbc_kb_ok" eval="1"/>
</record>
</data>
</openerp>
2 changes: 2 additions & 0 deletions l10n_id_djbc_kb_lap_common/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
from . import stock_picking_type
from . import stock_inventory
from . import stock_move
from . import product_template
from . import product_category
13 changes: 13 additions & 0 deletions l10n_id_djbc_kb_lap_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_kb_ok = fields.Boolean(
string="Category for DJBC KB",
)
27 changes: 27 additions & 0 deletions l10n_id_djbc_kb_lap_common/models/product_template.py
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 l10n_id_djbc_kb_lap_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_kb_ok"/>
</xpath>
</field>
</record>
</data>
</openerp>
21 changes: 21 additions & 0 deletions l10n_id_djbc_kb_lap_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_kb_ok"/>
<label for="djbc_kb_ok"/>
</div>
</xpath>
</field>
</record>
</data>
</openerp>

0 comments on commit fcafdc8

Please sign in to comment.