parent
e23b4412aa
commit
fe961c315f
|
@ -0,0 +1,28 @@
|
|||
diff --git a/trytond/trytond/modules/sale_credit_limit/sale.py b/trytond/trytond/modules/sale_credit_limit/sale.py
|
||||
index 9a60997..d209f72 100644
|
||||
--- a/trytond/trytond/modules/sale_credit_limit/sale.py
|
||||
+++ b/trytond/trytond/modules/sale_credit_limit/sale.py
|
||||
@@ -7,12 +7,21 @@ from trytond.pool import PoolMeta
|
||||
class Sale(metaclass=PoolMeta):
|
||||
__name__ = 'sale.sale'
|
||||
|
||||
+ def must_check_credit_limit(self):
|
||||
+ return self.shipment_method == 'order'
|
||||
+
|
||||
+ @property
|
||||
+ def credit_limit_amount(self):
|
||||
+ "Amount to check against credit limit"
|
||||
+ return self.untaxed_amount
|
||||
+
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('confirmed')
|
||||
def confirm(cls, sales):
|
||||
for sale in sales:
|
||||
- if sale.shipment_method == 'order':
|
||||
+ if sale.must_check_credit_limit():
|
||||
party = sale.invoice_party or sale.party
|
||||
- party.check_credit_limit(sale.untaxed_amount, origin=str(sale))
|
||||
+ party.check_credit_limit(
|
||||
+ sale.credit_limit_amount, origin=str(sale))
|
||||
super(Sale, cls).confirm(sales)
|
2
series
2
series
|
@ -73,3 +73,5 @@ issue11913.diff # [trytond] Too fast worker loop
|
|||
remove_left_right_project_work.diff # [project] Remove parent left and parent right for the project.work module.
|
||||
|
||||
stock_shipment.diff # [stock] No try to copy None moves when set transit location
|
||||
|
||||
issue11229.diff # [sale_credit] Sale with payments should not be blocked by credit limit
|
||||
|
|
Loading…
Reference in New Issue