diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-06-18 09:03:58 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-06-18 09:03:58 +0000 |
| commit | 393228f1b25d3fa460d8300c45642e66edbca88a (patch) | |
| tree | efbdf4f4e5057deadb2e2c78e08435884f2027db /indoteknik_custom/models/purchase_order.py | |
| parent | 4c3550dd2641b3f64d889d939e1eee400088188e (diff) | |
| parent | 386d64204b1e75d7aaa28cf1c7413b69938ee397 (diff) | |
Merged in date_bill_account (pull request #337)
Date bill account
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 004a1fa4..505df735 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -452,6 +452,18 @@ class PurchaseOrder(models.Model): 'company_id': self.company_id.id, 'payment_schedule': payment_schedule } + + receipt = self.env['stock.picking'].search([ + ('purchase_id', '=', self.id), + ('state', '=', 'done'), + ('picking_type_code', '=', 'incoming'), + ('date_done', '!=', False) + ], order='date_done desc', limit=1) + + if receipt: + invoice_vals['invoice_date'] = receipt.date_done + invoice_vals['date'] = receipt.date_done + return invoice_vals def _compute_matches_so(self): |
