Add patches over sale, purchase and stock_split modules
This commit is contained in:
parent
8fca23731e
commit
16abada580
|
@ -0,0 +1,14 @@
|
|||
Index: trytond/trytond/modules/stock_split/stock.py
|
||||
===================================================================
|
||||
|
||||
--- a/trytond/trytond/modules/stock_split/stock.py
|
||||
+++ b/trytond/trytond/modules/stock_split/stock.py
|
||||
@@ -59,6 +59,7 @@
|
||||
'uom': uom.id,
|
||||
}))
|
||||
remainder -= quantity
|
||||
+ remainder = Uom.round(remainder, uom.rounding)
|
||||
if count:
|
||||
count -= 1
|
||||
assert remainder >= 0
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
Index: trytond/trytond/modules/sale/sale.py
|
||||
===================================================================
|
||||
|
||||
--- a/trytond/trytond/modules/sale/sale.py
|
||||
+++ b/trytond/trytond/modules/sale/sale.py
|
||||
@@ -1347,7 +1347,8 @@
|
||||
old_invoice_line.quantity, self.unit)
|
||||
invoice_line.quantity = quantity
|
||||
|
||||
- if invoice_line.quantity <= 0.0:
|
||||
+ rounding = self.unit.rounding if self.unit else 0
|
||||
+ if invoice_line.quantity < rounding:
|
||||
return []
|
||||
invoice_line.unit = self.unit
|
||||
invoice_line.product = self.product
|
||||
@@ -1418,7 +1419,7 @@
|
||||
if move.id not in skip_ids:
|
||||
quantity -= Uom.compute_qty(move.uom, move.quantity,
|
||||
self.unit)
|
||||
- if quantity <= 0.0:
|
||||
+ if quantity < self.unit.rounding:
|
||||
return
|
||||
if not self.sale.party.customer_location:
|
||||
self.raise_user_error('customer_location_required', {
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
Index: trytond/trytond/modules/purchase/purchase.py
|
||||
===================================================================
|
||||
|
||||
--- a/trytond/trytond/modules/purchase/purchase.py
|
||||
+++ b/trytond/trytond/modules/purchase/purchase.py
|
||||
@@ -1220,7 +1220,8 @@
|
||||
old_invoice_line.quantity, self.unit)
|
||||
invoice_line.quantity = quantity
|
||||
|
||||
- if invoice_line.quantity <= 0.0:
|
||||
+ rounding = self.unit.rounding if self.unit else 0
|
||||
+ if invoice_line.quantity < rounding:
|
||||
return []
|
||||
invoice_line.unit = self.unit
|
||||
invoice_line.product = self.product
|
||||
@@ -1275,7 +1276,7 @@
|
||||
if move not in skip:
|
||||
quantity -= Uom.compute_qty(move.uom, move.quantity,
|
||||
self.unit)
|
||||
- if quantity <= 0.0:
|
||||
+ if quantity < self.unit.rounding:
|
||||
return
|
||||
if not self.purchase.party.supplier_location:
|
||||
self.raise_user_error('supplier_location_required', {
|
||||
|
Loading…
Reference in New Issue