diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-02-05 14:49:10 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-02-05 14:49:10 +0700 |
| commit | 98f44d62a1e818875911a29cb7a119907e5e2af1 (patch) | |
| tree | a29affc644486d3a4133c37ea5688c3c2c290984 | |
| parent | bacd84a9895031fdd5ce2f7ec0074f1bcd9e0a9a (diff) | |
automatic purchase change request
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 18 |
1 files changed, 17 insertions, 1 deletions
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") |
