mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Add option to force the posting of accounting move
This commit is contained in:
@@ -120,6 +120,9 @@ class AccountSpread(models.Model):
|
||||
display_recompute_buttons = fields.Boolean(
|
||||
compute='_compute_display_recompute_buttons',
|
||||
string='Display Buttons Recompute')
|
||||
display_move_line_auto_post = fields.Boolean(
|
||||
compute='_compute_display_move_line_auto_post',
|
||||
string='Display Button Auto-post lines')
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
@@ -195,6 +198,13 @@ class AccountSpread(models.Model):
|
||||
if spread.invoice_id.state == 'draft':
|
||||
spread.display_recompute_buttons = False
|
||||
|
||||
@api.multi
|
||||
def _compute_display_move_line_auto_post(self):
|
||||
for spread in self:
|
||||
spread.display_move_line_auto_post = True
|
||||
if spread.company_id.force_move_auto_post:
|
||||
spread.display_move_line_auto_post = False
|
||||
|
||||
@api.multi
|
||||
def _get_spread_entry_name(self, seq):
|
||||
"""Use this method to customise the name of the accounting entry."""
|
||||
|
||||
Reference in New Issue
Block a user