Avoid double write in stock move creation.
review635005 issue2937
This commit is contained in:
1 parent
e1d7c309f0
commit
fd7fc10c85
1 file changed
+1
-4
+1
-4
@@ -1217,6 +1217,7 @@ class PurchaseLine(ModelSQL, ModelView):
|
||||
move.unit_price = self.unit_price
|
||||
move.currency = self.purchase.currency
|
||||
move.planned_date = self.delivery_date
|
||||
move.purchase_line = self
|
||||
return move
|
||||
|
||||
def create_move(self):
|
||||
@@ -1227,10 +1228,6 @@ class PurchaseLine(ModelSQL, ModelView):
|
||||
if not move:
|
||||
return
|
||||
move.save()
|
||||
with Transaction().set_user(0, set_context=True):
|
||||
self.write([self], {
|
||||
'moves': [('add', [move.id])],
|
||||
})
|
||||
return move
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user