[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#60178

X-original-commit: d06f2060e8d5e5aa3e7bc1a37bb562bac0504e11
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
This commit is contained in:
Benjamin Frantzen (bfr)
2020-10-16 14:08:04 +00:00
parent be01bbd97f
commit 08a946c553
2 changed files with 3 additions and 3 deletions
@@ -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()
@@ -19,7 +19,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')