mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
@@ -49,6 +49,7 @@ class AccountMove(models.Model):
|
||||
intrastat_line_ids = fields.One2many(
|
||||
comodel_name="account.move.intrastat.line",
|
||||
inverse_name="move_id",
|
||||
groups="intrastat_product.group_invoice_intrastat_transaction_details",
|
||||
string="Intrastat declaration details",
|
||||
)
|
||||
|
||||
@@ -106,12 +107,15 @@ class AccountMoveLine(models.Model):
|
||||
_inherit = "account.move.line"
|
||||
|
||||
hs_code_id = fields.Many2one(
|
||||
comodel_name="hs.code", compute="_compute_hs_code_id", string="Intrastat Code",
|
||||
comodel_name="hs.code",
|
||||
compute="_compute_hs_code_id",
|
||||
string="Intrastat Code",
|
||||
compute_sudo=True,
|
||||
)
|
||||
|
||||
def _compute_hs_code_id(self):
|
||||
for rec in self:
|
||||
intrastat_line = self.move_id.intrastat_line_ids.filtered(
|
||||
intrastat_line = rec.move_id.intrastat_line_ids.filtered(
|
||||
lambda r: r.invoice_line_id == rec
|
||||
)
|
||||
rec.hs_code_id = (
|
||||
|
||||
Reference in New Issue
Block a user