mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Add 'post_move' option on account.payment.mode
This commit is contained in:
committed by
Enric Tobella
parent
67ef09a048
commit
6bd9f48aa6
@@ -73,6 +73,7 @@ class AccountPaymentMode(models.Model):
|
||||
('date', 'One move per payment date'),
|
||||
('line', 'One move per payment line'),
|
||||
], string='Move Option', default='date')
|
||||
post_move = fields.Boolean(string='Post Move')
|
||||
|
||||
@api.multi
|
||||
@api.constrains(
|
||||
|
||||
@@ -425,6 +425,7 @@ class AccountPaymentOrder(models.Model):
|
||||
"""
|
||||
self.ensure_one()
|
||||
am_obj = self.env['account.move']
|
||||
post_move = self.payment_mode_id.post_move
|
||||
# prepare a dict "trfmoves" that can be used when
|
||||
# self.payment_mode_id.move_option = date or line
|
||||
# key = unique identifier (date or True or line.id)
|
||||
@@ -451,4 +452,5 @@ class AccountPaymentOrder(models.Model):
|
||||
mvals['line_ids'].append((0, 0, trf_ml_vals))
|
||||
move = am_obj.create(mvals)
|
||||
blines.reconcile_payment_lines()
|
||||
move.post()
|
||||
if post_move:
|
||||
move.post()
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
attrs="{'invisible': [('offsetting_account', '!=', 'transfer_account')], 'required': [('offsetting_account', '=', 'transfer_account')]}"/>
|
||||
<field name="move_option"
|
||||
attrs="{'invisible': [('generate_move', '=', False)], 'required': [('generate_move', '=', True)]}"/>
|
||||
<field name="post_move"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user