Skip to content

Commit

Permalink
wms_connector: ADD inventory import support
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzPoize authored and kevinkhao committed Jan 9, 2024
1 parent 2774d83 commit 7df68b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wms_connector/models/attachment_synchronize_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
class AttachmentSynchronizeTask(models.Model):
_inherit = "attachment.synchronize.task"

default_warehouse_id = fields.Many2one("stock.warehouse")

file_type = fields.Selection(
selection_add=[
("export", "Export"),
Expand All @@ -15,3 +17,9 @@ class AttachmentSynchronizeTask(models.Model):
("wms_update_inventory", "Inventory update"),
]
)

def _prepare_attachment_vals(self, data, filename):
self.ensure_one()
vals = super()._prepare_attachment_vals(data, filename)
vals["default_warehouse_id"] = self.default_warehouse_id.id
return vals
1 change: 1 addition & 0 deletions wms_connector/models/stock_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def _prepare_wms_task_vals(
"filepath": filepath,
"backend_id": self.env.ref("fs_storage.default_fs_storage").id,
"file_type": filetype,
"default_warehouse_id": self.id,
}

def _prepare_wms_cron_vals(self, code="", name_fragment=""):
Expand Down

0 comments on commit 7df68b8

Please sign in to comment.