diff options
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 12 | ||||
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 35844c22..d3343e75 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -466,6 +466,16 @@ class ProductProduct(models.Model): qty = sum(qty_incoming.mapped('product_uom_qty')) product.qty_incoming_bandengan = qty + def _get_qty_incoming_bandengan_with_exclude(self): + for product in self: + qty_incoming = self.env['stock.move'].search([ + ('product_id', '=', product.id), + ('location_dest_id', 'in', [57, 83]), + ('state', 'not in', ['done', 'cancel']) + ]) + qty = sum(qty_incoming.mapped('product_uom_qty')) + product.qty_incoming_bandengan = qty + def _get_qty_outgoing_bandengan(self): for product in self: qty_incoming = self.env['stock.move'].search([ @@ -505,8 +515,6 @@ class ProductProduct(models.Model): product.max_qty_reorder = 0 else: product.max_qty_reorder = reordering.product_max_qty - test = reordering.product_max_qty - print(test) def _get_plafon_qty_product(self): for product in self: diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 510695a6..231acb4c 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -72,6 +72,8 @@ class PurchaseOrder(models.Model): grand_total = fields.Monetary(string='Grand Total', help='Amount total + amount delivery', compute='_compute_grand_total') total_margin_match = fields.Float(string='Total Margin Match', compute='_compute_total_margin_match') approve_by = fields.Many2one('res.users', string='Approve By') + exclude_incoming = fields.Boolean(string='Exclude Incoming', default=False, + help='Centang jika tidak mau masuk perhitungan Incoming Qty') def _compute_total_margin_match(self): for purchase in self: |
