summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/account_move.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-01-21 13:53:28 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-01-21 13:53:28 +0700
commit63433ff471ba98e6fc63bca16abd9a585471498b (patch)
tree7fe83758b1c40888bab68f5498e4a1c7da4d7891 /indoteknik_api/models/account_move.py
parentff20b62d6932c6be4ffb56f63f3c05be3aa72c06 (diff)
parente3521c2153c36cee6629cee9146e1b4b0201da9f (diff)
Merge branch 'odoo-production' into CR/form-merchant
# Conflicts: # indoteknik_api/models/res_partner.py # indoteknik_api/models/res_users.py # indoteknik_custom/__manifest__.py # indoteknik_custom/models/__init__.py # indoteknik_custom/models/res_partner.py # indoteknik_custom/security/ir.model.access.csv # indoteknik_custom/views/res_partner.xml # indoteknik_custom/views/user_company_request.xml
Diffstat (limited to 'indoteknik_api/models/account_move.py')
-rw-r--r--indoteknik_api/models/account_move.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_api/models/account_move.py b/indoteknik_api/models/account_move.py
index 23a7076c..645c157a 100644
--- a/indoteknik_api/models/account_move.py
+++ b/indoteknik_api/models/account_move.py
@@ -7,6 +7,7 @@ class AccountMove(models.Model):
def api_v1_single_response(self, account_move, context=False):
sale_order = self.env['sale.order'].search([('name', '=', account_move.invoice_origin), ('state', '=', 'done')], limit=1)
+ sale_order_v2 = self.env['sale.order'].search([('name', '=', account_move.invoice_origin)],limit=1)
amount_residual = account_move.amount_residual
if sale_order.payment_status == 'settlement' or sale_order.payment_status == 'capture':
amount_residual = 0
@@ -21,6 +22,9 @@ class AccountMove(models.Model):
'amount_residual': amount_residual,
'invoice_date': account_move.invoice_date.strftime('%d/%m/%Y') or '',
'efaktur': True if account_move.efaktur_document else False,
+ 'invoice_date_due': account_move.invoice_date_due.strftime('%d/%m/%Y') or '-',
+ 'sales_order': account_move.invoice_origin,
+ 'sales_order_id': sale_order_v2.id,
}
if isinstance(object, datetime.date):
data['invoice_date'] = account_move.invoice_date.strftime('%d/%m/%Y')
@@ -35,7 +39,6 @@ class AccountMove(models.Model):
'sales': account_move.invoice_user_id.name,
'amount_total': account_move.amount_total,
'amount_residual': amount_residual,
- 'invoice_date_due': account_move.invoice_date_due.strftime('%d/%m/%Y') or '',
'customer': res_users.api_address_response(account_move.partner_id),
'products': [],
}