diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 10:03:38 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 10:03:38 +0700 |
| commit | c8bdbbcf91fa5910e21c3279d9817a25a646a982 (patch) | |
| tree | fb856caafccae0d91a2d21c89f8f7b240511cdb3 | |
| parent | 3a18b6f0ca12384e009db08d99e94d38974f9811 (diff) | |
<Miqdad> fix invoice marketplace GL
| -rw-r--r-- | fixco_custom/models/account_move_line.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/fixco_custom/models/account_move_line.py b/fixco_custom/models/account_move_line.py index bf579f9..2aaf6d9 100644 --- a/fixco_custom/models/account_move_line.py +++ b/fixco_custom/models/account_move_line.py @@ -7,11 +7,26 @@ class AccountMoveLine(models.Model): qty_outstanding = fields.Float(string='Qty Outstanding', compute='_compute_qty_outstanding') invoice_marketplace = fields.Text("Invoice Mearketplace", compute='_compute_invoice_marketplace') - @api.depends('move_id', 'move_id.invoice_marketplace') + @api.depends( + 'move_id', + 'move_id.line_ids.matched_debit_ids', + 'move_id.line_ids.matched_credit_ids', + ) def _compute_invoice_marketplace(self): for line in self: - invoice_origin = line.move_id.invoice_marketplace - line.invoice_marketplace = invoice_origin + line.invoice_marketplace = False + move = line.move_id + + if not move: + continue + + # invoice + if move.move_type in ('out_invoice', 'in_invoice'): + line.invoice_marketplace = move.invoice_marketplace + # kas?/entries + else: + line.invoice_marketplace = move.reklas_used_by.invoice_marketplace if move.reklas_used_by else False + def _compute_qty_outstanding(self): for line in self: |
