summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/account_move.py
blob: 9fd6fb18c63e9ec7130c2611b73d6ea12236e5aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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