Skip to content

Commit

Permalink
wms_connector: reset wms_export_date and file when force cancel, so w…
Browse files Browse the repository at this point in the history
…e can re-export
  • Loading branch information
sebastienbeau committed Feb 25, 2024
1 parent d41fc57 commit a8e2251
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wms_connector/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class StockPicking(models.Model):
wms_import_attachment_id = fields.Many2one(
"attachment.queue", index=True, readonly=True
)
wms_export_date = fields.Datetime(tracking=True)

def _get_wms_export_task(self):
return self.picking_type_id.warehouse_id.sudo().wms_export_task_id
Expand All @@ -38,6 +39,8 @@ def _compute_is_wms_exportable(self):

def action_force_cancel_wms(self):
self.env.user.has_group("stock.group_stock_manager")
self.wms_export_date = None
self.wms_export_attachment_id.unlink()
return self.with_context(skip_wms_cancel_check=True).action_cancel()

def action_cancel(self):
Expand Down

0 comments on commit a8e2251

Please sign in to comment.