issue4322 account payment sepa
This commit is contained in:
parent
96f6f701b8
commit
69a89512b3
|
@ -0,0 +1,46 @@
|
||||||
|
diff -r 121f5e408156 trytond/trytond/modules/account_payment_sepa/payment.py
|
||||||
|
--- a/trytond/trytond/modules/account_payment_sepa/payment.py Wed Jan 11 13:47:05 2017 +0100
|
||||||
|
+++ b/trytond/trytond/modules/account_payment_sepa/payment.py Wed Jan 11 13:50:43 2017 +0100
|
||||||
|
@@ -139,9 +139,8 @@
|
||||||
|
Payment = pool.get('account.payment')
|
||||||
|
Message = pool.get('account.payment.sepa.message')
|
||||||
|
if self.kind == 'receivable':
|
||||||
|
- payments = [p for p in self.payments if not p.sepa_mandate]
|
||||||
|
- mandates = Payment.get_sepa_mandates(payments)
|
||||||
|
- for payment, mandate in zip(payments, mandates):
|
||||||
|
+ mandates = Payment.get_sepa_mandates(self.payments)
|
||||||
|
+ for payment, mandate in zip(self.payments, mandates):
|
||||||
|
if not mandate:
|
||||||
|
self.raise_user_error('no_mandate', payment.rec_name)
|
||||||
|
# Write one by one becasue mandate.sequence_type must be
|
||||||
|
@@ -217,14 +216,27 @@
|
||||||
|
'get_sepa_instruction_id', searcher='search_sepa_instruction_id')
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
+ def copy(cls, payments, default=None):
|
||||||
|
+ if default is None:
|
||||||
|
+ default = {}
|
||||||
|
+ default.setdefault('sepa_mandate_sequence_type', None)
|
||||||
|
+ return super(Payment, cls).copy(payments, default=default)
|
||||||
|
+
|
||||||
|
+ @classmethod
|
||||||
|
def get_sepa_mandates(cls, payments):
|
||||||
|
mandates = []
|
||||||
|
for payment in payments:
|
||||||
|
- for mandate in payment.party.sepa_mandates:
|
||||||
|
- if mandate.is_valid:
|
||||||
|
- break
|
||||||
|
+ if payment.sepa_mandate:
|
||||||
|
+ if payment.sepa_mandate.is_valid:
|
||||||
|
+ mandate = payment.sepa_mandate
|
||||||
|
+ else:
|
||||||
|
+ mandate = None
|
||||||
|
else:
|
||||||
|
- mandate = None
|
||||||
|
+ for mandate in payment.party.sepa_mandates:
|
||||||
|
+ if mandate.is_valid:
|
||||||
|
+ break
|
||||||
|
+ else:
|
||||||
|
+ mandate = None
|
||||||
|
mandates.append(mandate)
|
||||||
|
return mandates
|
6
series
6
series
|
@ -44,7 +44,7 @@ stock_supply_production-performance-improvement.diff
|
||||||
stock_supply-provisioning-location.diff
|
stock_supply-provisioning-location.diff
|
||||||
|
|
||||||
# Uncomment in TEB: companyia obligatoria a l'analitica
|
# Uncomment in TEB: companyia obligatoria a l'analitica
|
||||||
# analytic_account.diff
|
analytic_account.diff
|
||||||
|
|
||||||
top.diff
|
top.diff
|
||||||
issue15211002-sale-confirmed-to-done.diff
|
issue15211002-sale-confirmed-to-done.diff
|
||||||
|
@ -91,6 +91,7 @@ fix_rounding_in_sync_inventory_to_outgoing.patch
|
||||||
#024726_account_bank_remove_company.diff
|
#024726_account_bank_remove_company.diff
|
||||||
#024726_account_payment_type_remove_company.diff
|
#024726_account_payment_type_remove_company.diff
|
||||||
#stock_lot_improve_sync_inventory_to_outgoing.diff
|
#stock_lot_improve_sync_inventory_to_outgoing.diff
|
||||||
|
#stock_lot_fix_pick_product_without_outgoing_moves.diff
|
||||||
#purchase_fix_get_move_done_rounding.diff
|
#purchase_fix_get_move_done_rounding.diff
|
||||||
#multicompany_cron.diff
|
#multicompany_cron.diff
|
||||||
025476_5154_5155_5456_optimize_move_write_assign.diff
|
025476_5154_5155_5456_optimize_move_write_assign.diff
|
||||||
|
@ -118,6 +119,5 @@ lock_stock_move.diff
|
||||||
stock_inventory_consumables.diff
|
stock_inventory_consumables.diff
|
||||||
issue4495_5945.diff
|
issue4495_5945.diff
|
||||||
account_invoice_account.diff
|
account_invoice_account.diff
|
||||||
|
|
||||||
|
|
||||||
issue4384.diff
|
issue4384.diff
|
||||||
|
issue4322-account_payment_sepa.diff
|
||||||
|
|
Loading…
Reference in New Issue