1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/purchase_intrastat/models/purchase_order.py
2024-12-10 09:04:09 +07:00

15 lines
407 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
def _prepare_invoice(self):
res = super()._prepare_invoice()
if self.partner_id.country_id.intrastat:
res["intrastat_country_id"] = self.partner_id.country_id.id
return res