Add new patch, issue11229. (#13)

Task #067076
This commit is contained in:
juanjo-nan 2022-11-30 12:14:35 +01:00 committed by GitHub
parent e23b4412aa
commit fe961c315f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

28
issue11229.diff Normal file
View File

@ -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
View File

@ -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