From f1b964c1f8071370ee0cffe6458bb9dc67039542 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 21 Aug 2023 21:58:04 +0700 Subject: add group pricing --- indoteknik_custom/__manifest__.py | 1 + indoteknik_custom/models/__init__.py | 1 + indoteknik_custom/models/price_group.py | 28 +++++++++ indoteknik_custom/security/ir.model.access.csv | 1 + indoteknik_custom/views/price_group.xml | 82 ++++++++++++++++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 indoteknik_custom/models/price_group.py create mode 100644 indoteknik_custom/views/price_group.xml 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 @@ + + + + Price Group + price.group + tree,form + +

+ Add Price Group +

+
+
+ + + Price Group + price.group + + + + + + + + + + + + + + + Price Group + price.group + +
+ + + + + + + + + + + + + +
+
+
+ + +
+ + + Manufactures + x_manufactures + + + + + + + + + + + Manufactures + x_manufactures + + + + + + + + +
\ No newline at end of file -- cgit v1.2.3