- 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.
18 lines
1.1 KiB
Python
18 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
from odoo import models, fields
|
|
import logging
|
|
|
|
_logger = logging.getLogger(__name__)
|
|
DEFAULT_BLOCKING_LEVEL = 'warning' # Keep previous behavior. TODO : when account_edi_extended is merged with account_edi, should be 'error' (document will not be processed again until forced retry or reset to draft)
|
|
|
|
|
|
class AccountEdiDocument(models.Model):
|
|
_inherit = 'account.edi.document'
|
|
|
|
blocking_level = fields.Selection(selection=[('info', 'Info'), ('warning', 'Warning'), ('error', 'Error')],
|
|
help="Blocks the document current operation depending on the error severity :\n"
|
|
" * Info: the document is not blocked and everything is working as it should.\n"
|
|
" * Warning : there is an error that doesn't prevent the current Electronic Invoicing operation to succeed.\n"
|
|
" * Error : there is an error that blocks the current Electronic Invoicing operation.")
|