summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/models/purchase_order.py27
1 files changed, 2 insertions, 25 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 889fc80e..a9d9cc6b 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -7,12 +7,6 @@ class PurchaseOrder(models.Model):
sale_order_id = fields.Many2one('sale.order', string='Sale Order')
procurement_status = fields.Char(string='Procurement Status', compute='get_procurement_status', readonly=True)
- total_margin = fields.Float(
- 'Total Margin', compute='compute_total_margin',
- help="Total Margin in Sales Order Header")
- total_percent_margin = fields.Float(
- 'Total Percent Margin', compute='compute_total_margin',
- help="Total % Margin in Sales Order Header")
approval_status = fields.Selection([
('pengajuan1', 'Approval Manager'), #siapa? darren - 11
('pengajuan2', 'Approval Pimpinan'), #akbar - 7
@@ -77,23 +71,6 @@ class PurchaseOrder(models.Model):
amount += line.price_total
order.delivery_amount = amount
- def compute_total_margin(self):
- for po in self:
- po.total_margin = 0
- po.total_percent_margin = 0
- for po in self:
- total_margin = total_percent_margin = 0
- for line in po.order_line:
- if not line.product_id:
- po.total_margin = 0
- po.total_percent_margin = 0
- continue
- total_margin += line.item_margin
- po.total_margin = total_margin
- if po.amount_untaxed > 0:
- total_percent_margin = round((total_margin / po.amount_untaxed), 2) * 100
- po.total_percent_margin = total_percent_margin
-
def button_confirm(self):
res = super(PurchaseOrder, self).button_confirm()
@@ -111,9 +88,9 @@ class PurchaseOrder(models.Model):
real_tax_amount += tax.amount
if (sale_order_line.purchase_tax_id.amount != real_tax_amount or count_real_tax > 1 \
or real_tax.price_include != sale_order_line.purchase_tax_id.price_include) and (self.env.user.id != 6):
- raise UserError("Beda tax amount dengan Sales, harus Approval Pak Tyas")
+ raise UserError("Beda tax amount dengan Sales, harus Approval Manager")
elif est_purchase_price != real_purchase_price and self.env.user.id != 6:
- raise UserError("Beda Price dengan Sales, harus Approval Pak Tyas")
+ raise UserError("Beda Price dengan Sales, harus Approval Manager")
self.approval_status = 'approved'
return res