Skip to content

Commit

Permalink
[FIX] stock: fix api multi method
Browse files Browse the repository at this point in the history
Method was using self instead of line in the loop for.

introduced in rev: odoo@ba5918f
  • Loading branch information
pimodoo committed Jul 5, 2018
1 parent b7bcbdd commit 6bdc654
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addons/stock/models/stock_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,13 @@ def write(self,vals):
def _check_no_duplicate_line(self):
for line in self:
existings = self.search([
('id', '!=', self.id),
('product_id', '=', self.product_id.id),
('id', '!=', line.id),
('product_id', '=', line.product_id.id),
('inventory_id.state', '=', 'confirm'),
('location_id', '=', self.location_id.id),
('partner_id', '=', self.partner_id.id),
('package_id', '=', self.package_id.id),
('prod_lot_id', '=', self.prod_lot_id.id)])
('location_id', '=', line.location_id.id),
('partner_id', '=', line.partner_id.id),
('package_id', '=', line.package_id.id),
('prod_lot_id', '=', line.prod_lot_id.id)])
if existings:
raise UserError(_("You cannot have two inventory adjustments in state 'In Progress' with the same product,"
" same location, same package, same owner and same lot. Please first validate"
Expand Down

0 comments on commit 6bdc654

Please sign in to comment.