diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-01-26 17:00:04 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-01-26 17:00:04 +0700 |
| commit | e48e4626b94f7e09b3bab95937cf4b7a5ca07e40 (patch) | |
| tree | a5a5da1f38d786bf81b9746ed291376c815ce1f4 /indoteknik_api/models | |
| parent | 3e587f4e4fd0dbd8fee3e627ff5665c6b7b78302 (diff) | |
api invoice and invoice detail
Diffstat (limited to 'indoteknik_api/models')
| -rw-r--r-- | indoteknik_api/models/__init__.py | 1 | ||||
| -rw-r--r-- | indoteknik_api/models/account_move.py | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/indoteknik_api/models/__init__.py b/indoteknik_api/models/__init__.py index 12a1f7fd..98d84a80 100644 --- a/indoteknik_api/models/__init__.py +++ b/indoteknik_api/models/__init__.py @@ -1,3 +1,4 @@ +from . import account_move from . import blog_post from . import product_pricelist from . import product_product diff --git a/indoteknik_api/models/account_move.py b/indoteknik_api/models/account_move.py new file mode 100644 index 00000000..9fd6fb18 --- /dev/null +++ b/indoteknik_api/models/account_move.py @@ -0,0 +1,20 @@ +import datetime +from odoo import models +from pytz import timezone + + +class AccountMove(models.Model): + _inherit = 'account.move' + + def api_v1_single_response(self, account_move): + data = { + 'id': account_move.id, + 'name': account_move.name, + 'purchase_order_name': account_move.ref or '', + 'payment_term': account_move.invoice_payment_term_id.name or '', + 'sales': account_move.invoice_user_id.name, + 'amount_total': account_move.amount_total, + 'amount_residual': account_move.amount_residual, + 'invoice_date': account_move.invoice_date.strftime('%d/%m/%Y') or '' + } + return data |
