Skip to content
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
[IMP] sale_margin_sync: black, isort, prettier
  • Loading branch information
rafamarpe authored and BhaveshHeliconia committed Dec 15, 2025
commit 74b57b2c093d6d9c1eaa83b496e1fb4754650b55
6 changes: 2 additions & 4 deletions sale_margin_sync/models/stock_valuation_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class StockValuationLayer(models.Model):

@api.model_create_multi
def create(self, vals_list):
"""Update purchase price from sale line linked to svl record
"""
"""Update purchase price from sale line linked to svl record"""
svls = super().create(vals_list)
if not self.env.context.get("skip_sale_margin_sync", False):
svls.filtered("stock_move_id.sale_line_id").sale_margin_sync()
Expand All @@ -25,7 +24,6 @@ def write(self, vals):
return res

def sale_margin_sync(self):
"""Only synchronize outgoing moves
"""
"""Only synchronize outgoing moves"""
for svl in self.filtered(lambda l: (l.quantity < 0.0)):
svl.stock_move_id.sale_line_id.purchase_price = svl.unit_cost