Files
odoo_source/addons/account_edi_extended/__init__.py
T
Benjamin Frantzen (bfr) ce674f1b21 [IMP] account_edi: added error_level + better management of Lock on account.move
- Some errors will never get fixed until user intervention, it doesn't make sense to run the CRON when there is such error.
+ some small improvements and esthetic changes
- When we are in a CRON, we need to commit the changes between each call to web-service to avoid loss of data.
- Small refactor of edi.document prepare_jobs and process_jobs
- Added an arbitrary key to create the batches.
2021-02-01 14:41:58 +00:00

14 lines
477 B
Python

# -*- encoding: utf-8 -*-
from . import models
from odoo import api, SUPERUSER_ID
def account_edi_block_level(cr, registery):
''' The default value for blocking_level is 'error', but without this module,
the behavior is the same as a blocking_level of 'warning' so we need to set
all documents in error.
'''
env = api.Environment(cr, SUPERUSER_ID, {})
env['account.edi.document'].search([('error', '!=', False)]).write({'blocking_level': 'warning'})