- 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.
14 lines
477 B
Python
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'})
|