优化代码结构

This commit is contained in:
mgw
2023-11-20 13:23:37 +08:00
parent 5bdd3982ae
commit 718b1f9edf
11 changed files with 63 additions and 76 deletions

View File

@@ -105,7 +105,6 @@ class StatusChange(models.Model):
#
# return True
# def action_cancel(self):
# """ Cancel SO after showing the cancel wizard when needed. (cfr `_show_cancel_wizard`)
#
@@ -205,12 +204,12 @@ class FinishStatusChange(models.Model):
[('id', 'child_of', self.picking_type_id.warehouse_id.view_location_id.id),
('usage', '!=', 'supplier')])
if self.env['stock.move'].search([
('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']),
('product_qty', '>', 0),
('location_id', 'in', wh_location_ids),
('move_orig_ids', '=', False),
('picking_id', 'not in', self.ids),
('product_id', 'in', lines.product_id.ids)], limit=1):
('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']),
('product_qty', '>', 0),
('location_id', 'in', wh_location_ids),
('move_orig_ids', '=', False),
('picking_id', 'not in', self.ids),
('product_id', 'in', lines.product_id.ids)], limit=1):
action = self.action_view_reception_report()
action['context'] = {'default_picking_ids': self.ids}
return action