summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-08-21 21:58:04 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-08-21 21:58:04 +0700
commitf1b964c1f8071370ee0cffe6458bb9dc67039542 (patch)
tree887883bdf1c0cee763b77b62a7fc9e4e63a68a04
parent60ed70b31d47b5ee5fbc0bdb0c3de34820495600 (diff)
add group pricing
-rwxr-xr-xindoteknik_custom/__manifest__.py1
-rwxr-xr-xindoteknik_custom/models/__init__.py1
-rw-r--r--indoteknik_custom/models/price_group.py28
-rwxr-xr-xindoteknik_custom/security/ir.model.access.csv1
-rw-r--r--indoteknik_custom/views/price_group.xml82
5 files changed, 113 insertions, 0 deletions
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py
index 18031c25..7c38382c 100755
--- a/indoteknik_custom/__manifest__.py
+++ b/indoteknik_custom/__manifest__.py
@@ -90,6 +90,7 @@
'views/airway_bill.xml',
'views/product_attribute_value.xml',
'views/mail_template_po.xml',
+ 'views/price_group.xml',
'report/report.xml',
'report/report_banner_banner.xml',
'report/report_banner_banner2.xml',
diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py
index 5de392ca..255a12f6 100755
--- a/indoteknik_custom/models/__init__.py
+++ b/indoteknik_custom/models/__init__.py
@@ -80,3 +80,4 @@ from . import account_financial_report
from . import account_general_ledger
from . import account_report_financial
from . import account_report_general_ledger
+from . import price_group
diff --git a/indoteknik_custom/models/price_group.py b/indoteknik_custom/models/price_group.py
new file mode 100644
index 00000000..50f0520f
--- /dev/null
+++ b/indoteknik_custom/models/price_group.py
@@ -0,0 +1,28 @@
+from odoo import fields, models, api
+from odoo.exceptions import UserError
+import logging
+
+_logger = logging.getLogger(__name__)
+
+
+class PriceGroup(models.Model):
+ _name = 'price.group'
+
+ name = fields.Char(string='Name')
+ pricelist_id = fields.Many2one('product.pricelist', string='Price List')
+ group1 = fields.Float(string='Kelompok 1 (%)')
+ group2 = fields.Float(string='Kelompok 2 (%)')
+ group3 = fields.Float(string='Kelompok 3 (%)')
+ group4 = fields.Float(string='Kelompok 4 (%)')
+ group5 = fields.Float(string='Kelompok 5 (%)')
+
+class Manufacture(models.Model):
+ _inherit = 'x_manufactures'
+
+ pricing_group = fields.Selection([
+ ('group1', 'Kelompok 1'),
+ ('group2', 'Kelompok 2'),
+ ('group3', 'Kelompok 3'),
+ ('group4', 'Kelompok 4'),
+ ('group5', 'Kelompok 5'),
+ ], string='Pricing Group', copy=False)
diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv
index b3dce428..6f9ba9e4 100755
--- a/indoteknik_custom/security/ir.model.access.csv
+++ b/indoteknik_custom/security/ir.model.access.csv
@@ -66,3 +66,4 @@ access_bill_receipt_line,access.bill.receipt.line,model_bill_receipt_line,,1,1,1
access_account_move_multi_update,access.account.move.multi_update,model_account_move_multi_update,,1,1,1,1
access_airway_bill,access.airway.bill,model_airway_bill,,1,1,1,1
access_airway_bill_manifest,access.airway.bill.manifest,model_airway_bill_manifest,,1,1,1,1
+access_price_group,access.price.group,model_price_group,,1,1,1,1
diff --git a/indoteknik_custom/views/price_group.xml b/indoteknik_custom/views/price_group.xml
new file mode 100644
index 00000000..7ee8d422
--- /dev/null
+++ b/indoteknik_custom/views/price_group.xml
@@ -0,0 +1,82 @@
+<odoo>
+ <data>
+ <record id="price_group_action" model="ir.actions.act_window">
+ <field name="name">Price Group</field>
+ <field name="res_model">price.group</field>
+ <field name="view_mode">tree,form</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Add Price Group
+ </p>
+ </field>
+ </record>
+
+ <record id="price_group_tree" model="ir.ui.view">
+ <field name="name">Price Group</field>
+ <field name="model">price.group</field>
+ <field name="arch" type="xml">
+ <tree>
+ <field name="name"/>
+ <field name="pricelist_id"/>
+ <field name="group1"/>
+ <field name="group2"/>
+ <field name="group3"/>
+ <field name="group4"/>
+ <field name="group5"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="price_group_form" model="ir.ui.view">
+ <field name="name">Price Group</field>
+ <field name="model">price.group</field>
+ <field name="arch" type="xml">
+ <form>
+ <sheet>
+ <group>
+ <group>
+ <field name="name"/>
+ <field name="pricelist_id"/>
+ <field name="group1"/>
+ <field name="group2"/>
+ <field name="group3"/>
+ <field name="group4"/>
+ <field name="group5"/>
+ </group>
+ </group>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ <menuitem id="price_group"
+ name="Price Group"
+ parent="sale.product_menu_catalog"
+ sequence="100"
+ action="price_group_action"/>
+ </data>
+ <data>
+ <record id="x_manufactures_form_pricing_group" model="ir.ui.view">
+ <field name="name">Manufactures</field>
+ <field name="model">x_manufactures</field>
+ <field name="inherit_id" ref="indoteknik_custom.x_manufactures_form"/>
+ <field name="arch" type="xml">
+ <field name="vendor_ids" position="after">
+ <field name="pricing_group"/>
+ </field>
+ </field>
+ </record>
+ </data>
+ <data>
+ <record id="x_manufactures_tree_pricing_group" model="ir.ui.view">
+ <field name="name">Manufactures</field>
+ <field name="model">x_manufactures</field>
+ <field name="inherit_id" ref="indoteknik_custom.x_manufactures_tree"/>
+ <field name="arch" type="xml">
+ <field name="parent_id" position="after">
+ <field name="pricing_group" optional="hide"/>
+ </field>
+ </field>
+ </record>
+ </data>
+</odoo> \ No newline at end of file