From 98f44d62a1e818875911a29cb7a119907e5e2af1 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 5 Feb 2024 14:49:10 +0700 Subject: automatic purchase change request --- indoteknik_custom/models/automatic_purchase.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index d0bbdb1e..4051c093 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -283,7 +283,7 @@ class AutomaticPurchase(models.Model): purchase_pricelist = self.env['purchase.pricelist'].search(domain, order=orderby, limit=1) vendor_id = purchase_pricelist.vendor_id - price = self._get_valid_purchase_price(purchase_pricelist) + price = self._get_vaokelid_purchase_price(purchase_pricelist) last_po_line = self.env['purchase.order.line'].search([('product_id', '=', job.product_id.id), ('order_id.state', '=', 'done')], order='id desc', limit=1) self.env['automatic.purchase.line'].create([{ @@ -460,3 +460,19 @@ class AutomaticPurchaseSalesMatch(models.Model): product_id = fields.Many2one('product.product', string='Product') qty_so = fields.Float(string='Qty SO') qty_po = fields.Float(string='Qty PO') + + +class SyncPurchasingJob(models.Model): + _name = 'sync.purchasing.job' + _auto = False + _rec_name = 'product_id' + + automatic_purchase_id = fields.Many2one('automatic.purchase', string='Ref', required=True, ondelete='cascade', index=True, copy=False) + product_id = fields.Many2one('product.product', string="Product") + brand = fields.Char(string='Brand') + item_code = fields.Char(string='Item Code') + product = fields.Char(string='Product Name') + onhand = fields.Float(string='OnHand') + incoming = fields.Float(string="Incoming") + outgoing = fields.Float(string="Outgoing") + action = fields.Char(string="Status") -- cgit v1.2.3