summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-02-18 12:09:46 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-02-18 12:09:46 +0700
commit2f33ecda0f0d51d8e336aad4d7f84777faa4e59c (patch)
tree742f218d141417e63bd395bc0f8765d00f2ba569
parent5e5602ca0892553b386def5d01368012ad99ca59 (diff)
<Miqdad> push
-rw-r--r--fixco_custom/models/account_move.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py
index c1098d0..6722714 100644
--- a/fixco_custom/models/account_move.py
+++ b/fixco_custom/models/account_move.py
@@ -15,7 +15,7 @@ _logger = logging.getLogger(__name__)
class AccountMove(models.Model):
_inherit = 'account.move'
- invoice_marketplace = fields.Char('Invoice Marketplace')
+ invoice_marketplace = fields.Char('Invoice Marketplace', compute='_compute_invoice_marketplace')
address = fields.Char('Address')
sale_id = fields.Many2one('sale.order', string='Sale Order')
picking_id = fields.Many2one('stock.picking', string='Picking')
@@ -62,6 +62,14 @@ class AccountMove(models.Model):
)
soo_number = fields.Char('SOO Number')
+ @api.depends('sale_id')
+ def _compute_invoice_marketplace(self):
+ for move in self:
+ if move.sale_id:
+ move.invoice_marketplace = move.sale_id.invoice_mp if move.sale_id else False
+ else:
+ move.invoice_marketplace = False
+
@api.depends('line_ids.partner_id')
def _compute_partner_compute(self):
for move in self:
@@ -305,6 +313,8 @@ class AccountMove(models.Model):
entry.soo_number = ', '.join(soo_list)
if entry.move_type == 'out_invoice':
+ search_inv = entry.search([('move_type', '=', 'out_invoice'), ('id', '=', entry.id), ('invoice_marketplace', '=', entry.sale_id.invoice_mp)], limit=1).invoice_marketplace
+ entry.invoice_marketplace = search_inv
if entry.picking_id:
entry.invoice_date = entry.picking_id.date_done