diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-15 15:47:05 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-15 15:47:05 +0700 |
| commit | 55c67c71b04fce80c635b3a58d91c8bcb02e17c8 (patch) | |
| tree | ed8833b969800e36b887b4134c14dab89d3b91c7 /indoteknik_custom/models/automatic_purchase.py | |
| parent | 1f2995a85428ac4335123bd33d48ae17d3c9f36f (diff) | |
| parent | 24649f8e939484759ef34e5e68f251d951f63c02 (diff) | |
Merge commit '24649f8e939484759ef34e5e68f251d951f63c02'
Conflicts:
indoteknik_custom/__manifest__.py
indoteknik_custom/security/ir.model.access.csv
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index eea66b99..87319bf6 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -88,7 +88,7 @@ class AutomaticPurchase(models.Model): if point.product_id.virtual_available > point.product_min_qty: continue qty_purchase = point.product_max_qty - point.product_id.virtual_available - po_line = self.env['purchase.order.line'].search([('product_id', '=', point.product_id.id), ('order_id.state', '=', 'done')], limit=1) + po_line = self.env['purchase.order.line'].search([('product_id', '=', point.product_id.id), ('order_id.state', '=', 'done')], order='id desc', limit=1) if self.vendor_id: purchase_price = self.env['purchase.pricelist'].search([ |
