summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2024-01-22 15:23:55 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2024-01-22 15:23:55 +0700
commit5b9451c11b369c74e287786612a5cd97fcd27c10 (patch)
tree81d8398f5448797a6da40cd0eaf6c5920112bade
parent10c3e0308d8c71654e451b2f3b06083b7b1b7791 (diff)
parent14545d90b2c35a61c1a269c48b480dc82a099510 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
-rwxr-xr-xindoteknik_custom/models/purchase_pricelist.py21
-rwxr-xr-xindoteknik_custom/views/purchase_pricelist.xml6
2 files changed, 25 insertions, 2 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py
index 86bb2f54..b85df109 100755
--- a/indoteknik_custom/models/purchase_pricelist.py
+++ b/indoteknik_custom/models/purchase_pricelist.py
@@ -11,12 +11,14 @@ class PurchasePricelist(models.Model):
product_id = fields.Many2one('product.product', string="Product", required=True)
vendor_id = fields.Many2one('res.partner', string="Vendor", required=True)
product_price = fields.Float(string='Human Price', required=True)
- system_price = fields.Float(string='System Price', required=True)
+ system_price = fields.Float(string='System Price', readonly=True)
human_last_update = fields.Datetime(string='Human Update')
system_last_update = fields.Datetime(string='System Update')
count_trx_po = fields.Integer(string='Count Trx Product')
count_trx_po_vendor = fields.Integer(string='Count Trx Vendor')
-
+ taxes_product_id = fields.Many2one('account.tax', string='Taxes Human')
+ taxes_system_id = fields.Many2one('account.tax', string='Taxes System', readonly=True)
+ include_price = fields.Float(string='Include Price', readonly=True)
@api.depends('product_id', 'vendor_id')
def _compute_name(self):
self.name = self.vendor_id.name + ', ' + self.product_id.name
@@ -30,6 +32,21 @@ class PurchasePricelist(models.Model):
else:
self.human_last_update = current_time
+ # @api.constrains('system_last_update','system_price')
+ # def _contrains_include_price(self):
+ # taxes = self.taxes_system_id or self.taxes_product_id
+ # tax_include = taxes.price_include
+ # price_unit = self.system_price or self.product_price
+ # if taxes:
+ # if tax_include:
+ # price_unit = price_unit
+ # else:
+ # price_unit = price_unit + (price_unit * 11 / 100)
+ # else:
+ # price_unit = price_unit + (price_unit * 11 / 100)
+
+ # self.include_price = price_unit
+
@api.constrains('vendor_id', 'product_id')
def _check_duplicate_purchase_pricelist(self):
for price in self:
diff --git a/indoteknik_custom/views/purchase_pricelist.xml b/indoteknik_custom/views/purchase_pricelist.xml
index f4cd4e78..df379804 100755
--- a/indoteknik_custom/views/purchase_pricelist.xml
+++ b/indoteknik_custom/views/purchase_pricelist.xml
@@ -8,7 +8,10 @@
<field name="product_id"/>
<field name="vendor_id"/>
<field name="product_price"/>
+ <field name="taxes_product_id"/>
<field name="system_price"/>
+ <field name="taxes_system_id"/>
+ <field name="include_price"/>
<field name="human_last_update"/>
<field name="system_last_update"/>
<field name="count_trx_po"/>
@@ -28,7 +31,10 @@
<field name="product_id"/>
<field name="vendor_id" context="{'res_partner_search_mode': 'supplier'}"/>
<field name="product_price"/>
+ <field name="taxes_product_id"/>
<field name="system_price"/>
+ <field name="taxes_system_id"/>
+ <field name="include_price"/>
<field name="human_last_update"/>
<field name="system_last_update"/>
<field name="count_trx_po"/>