diff options
| author | Benjamin Frantzen (bfr) <bfr@odoo.com> | 2020-10-16 09:28:26 +0000 |
|---|---|---|
| committer | Benjamin Frantzen (bfr) <bfr@odoo.com> | 2020-10-16 09:52:32 +0000 |
| commit | d06f2060e8d5e5aa3e7bc1a37bb562bac0504e11 (patch) | |
| tree | 209c7a8cf6bbf599bab531dd9e56d4f7793dffcd /addons | |
| parent | 623c5176a37ae5fd048d6bb10e742fac5caa6cf2 (diff) | |
[FIX] account_edi: set required to fields
- account.edi.document require edi_format_id and move_id because it's its very own reason of existence
- account.edi.format require code because it's the way it's identified
closes odoo/odoo#60155
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Diffstat (limited to 'addons')
| -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') |
