mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Add option to auto-archive spreads
This commit is contained in:
@@ -166,3 +166,8 @@ class AccountInvoiceSpreadLine(models.Model):
|
||||
'move_id').filtered(lambda m: m.state != 'posted')
|
||||
unposted_moves.filtered(
|
||||
lambda m: m.company_id.force_move_auto_post).post()
|
||||
|
||||
spreads_to_archive = self.env['account.spread'].search([
|
||||
('all_posted', '=', True)
|
||||
]).filtered(lambda s: s.company_id.auto_archive)
|
||||
spreads_to_archive.write({'active': False})
|
||||
|
||||
Reference in New Issue
Block a user