Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wms_connector: fix picking copy #12

Open
wants to merge 1 commit into
base: 14.0-wms_connector
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions wms_connector/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class StockPicking(models.Model):
compute="_compute_wms_sync_cancel_supported"
)
wms_import_attachment_id = fields.Many2one(
"attachment.queue", index=True, readonly=True
"attachment.queue", index=True, readonly=True, copy=False
)
wms_export_date = fields.Datetime(tracking=True)
wms_export_date = fields.Datetime(tracking=True, copy=False)

def _get_wms_export_task(self):
return self.picking_type_id.warehouse_id.sudo().wms_export_task_id
Expand Down Expand Up @@ -72,3 +72,16 @@ def _wms_check_if_editable(self):
_("The picking %s have been exported and can not be modified")
% picking.name
)

def _create_backorder(self):
backorders = super()._create_backorder()
for backorder in backorders:
picking = backorder.backorder_id
if picking.wms_export_date:
backorder.write(
{
"wms_export_date": picking.wms_export_date,
"wms_import_attachment_id": picking.wms_import_attachment_id.id,
}
)
return backorders
Loading