diff options
| -rw-r--r-- | addons/account_edi/models/account_edi_document.py | 4 | ||||
| -rw-r--r-- | addons/account_edi/models/account_edi_format.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/account_edi/models/account_edi_document.py b/addons/account_edi/models/account_edi_document.py index e3a858ffd53..af128e474f8 100644 --- a/addons/account_edi/models/account_edi_document.py +++ b/addons/account_edi/models/account_edi_document.py @@ -13,8 +13,8 @@ class AccountEdiDocument(models.Model): _description = 'Electronic Document for an account.move' # == Stored fields == - move_id = fields.Many2one('account.move') - edi_format_id = fields.Many2one('account.edi.format') + move_id = fields.Many2one('account.move', required=True, ondelete='cascade') + edi_format_id = fields.Many2one('account.edi.format', required=True) attachment_id = fields.Many2one('ir.attachment', help='The file generated by edi_format_id when the invoice is posted (and this document is processed).') state = fields.Selection([('to_send', 'To Send'), ('sent', 'Sent'), ('to_cancel', 'To Cancel'), ('cancelled', 'Cancelled')]) error = fields.Html() diff --git a/addons/account_edi/models/account_edi_format.py b/addons/account_edi/models/account_edi_format.py index f9f4d07c322..e66338f5ae7 100644 --- a/addons/account_edi/models/account_edi_format.py +++ b/addons/account_edi/models/account_edi_format.py @@ -18,7 +18,7 @@ class AccountEdiFormat(models.Model): _description = 'EDI format' name = fields.Char() - code = fields.Char() + code = fields.Char(required=True) _sql_constraints = [ ('unique_code', 'unique (code)', 'This code already exists') |
