diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-02-28 14:56:34 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-02-28 14:56:34 +0700 |
| commit | 58024d6e0849400bb9c86f7c7988b163958eebe0 (patch) | |
| tree | 4cb86717a95a818bf293febdceb346e9f7da9b1b /indoteknik_custom/models/account_move.py | |
| parent | 46a7cc5601ceab2a7a6cdf4d74e0fa26ce13ab8a (diff) | |
delivery invoice address on so and invoices
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 7eb65e9f..b505850f 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -39,6 +39,18 @@ class AccountMove(models.Model): reklas_id = fields.Many2one('account.move', string='Nomor CAB', domain="[('partner_id', '=', partner_id)]") new_invoice_day_to_due = fields.Integer(string="New Day Due", compute="_compute_invoice_day_to_due") date_efaktur_upload = fields.Datetime(string='eFaktur Upload Date', tracking=True) + real_invoice_id = fields.Many2one( + 'res.partner', string='Delivery Invoice Address', readonly=True, required=True, + states={'draft': [('readonly', False)], 'sent': [('readonly', False)], 'sale': [('readonly', False)]}, + domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", + help="Dipakai untuk alamat tempel") + + address_invoice = fields.Char(related='real_invoice_id.street', string='Invoice Address', readonly=True) + + @api.constrains('partner_id') + def _constrains_real_invoice(self): + for move in self: + move.real_invoice_id = move.sale_id.real_invoice_id @api.constrains('efaktur_document') def _constrains_date_efaktur(self): |
