Commit 9e7ead13 by François C.

Merge branch '5113-probleme-mise-a-jour-prix-cause-fournisseurs-meme-sequence'…

Merge branch '5113-probleme-mise-a-jour-prix-cause-fournisseurs-meme-sequence' into 'dev_cooperatic'

handle case of current vendor sharing min sequence with at least another vendor…

See merge request !62
parents 9153baf5 02591311
......@@ -35,10 +35,10 @@ class PurchaseOrderLine(models.Model):
current_sequence = vendor_price_line.sequence
# No update if the current vendor is the main one
if vendor_price_line.sequence != min_sequence:
if vendor_price_line.sequence != min_sequence or product.seller_ids.mapped('sequence').count(min_sequence) > 1:
for seller in product.seller_ids:
if seller.id != vendor_price_line.id and \
seller.sequence < current_sequence:
seller.sequence <= current_sequence:
seller.write({'sequence': seller.sequence + 1})
main_vendor = vendor_price_line.name
vendor_price_line.write({'sequence': min_sequence})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment