Skip to content

Commit

Permalink
[14.0][IMP] support company dependent fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Kev-Roche committed Sep 6, 2023
1 parent 6f9aad4 commit 80c9239
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pattern_import_export/models/pattern_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ class PatternFile(models.Model):
chunk_ids = fields.One2many("pattern.chunk", "pattern_file_id", "Chunk")
date_done = fields.Datetime()

company_id = fields.Many2one(
comodel_name="res.company",
default=lambda self: self.env.company.id,
required=False,
string="Company",
)

@api.depends("chunk_ids.nbr_error", "chunk_ids.nbr_success")
def _compute_stat(self):
for record in self:
Expand Down
1 change: 1 addition & 0 deletions pattern_import_export/wizard/import_pattern_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def action_launch_import(self):
"datas": self.import_file,
"kind": "import",
"pattern_config_id": self.pattern_config_id.id,
"company_id": self.env.company.id,
}
)
pattern_file_import.with_delay(
Expand Down

0 comments on commit 80c9239

Please sign in to comment.