Skip to content

Commit

Permalink
edi: fix record and type copy on fields
Browse files Browse the repository at this point in the history
  • Loading branch information
simahawk committed Aug 25, 2023
1 parent 3895a26 commit 076ad12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions edi_oca/models/edi_exchange_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class EDIExchangeRecord(models.Model):
_order = "exchanged_on desc, id desc"
_rec_name = "identifier"

identifier = fields.Char(required=True, index=True, readonly=True)
external_identifier = fields.Char(index=True, readonly=True)
identifier = fields.Char(required=True, index=True, readonly=True, copy=False)
external_identifier = fields.Char(index=True, readonly=True, copy=False)
type_id = fields.Many2one(
string="Exchange type",
comodel_name="edi.exchange.type",
Expand All @@ -38,9 +38,10 @@ class EDIExchangeRecord(models.Model):
required=False,
readonly=True,
model_field="model",
copy=False,
)
related_name = fields.Char(compute="_compute_related_name", compute_sudo=True)
exchange_file = fields.Binary(attachment=True)
exchange_file = fields.Binary(attachment=True, copy=False)
exchange_filename = fields.Char(
compute="_compute_exchange_filename", readonly=False, store=True
)
Expand All @@ -53,6 +54,7 @@ class EDIExchangeRecord(models.Model):
edi_exchange_state = fields.Selection(
string="Exchange state",
readonly=True,
copy=False,
default="new",
selection=[
# Common states
Expand All @@ -72,7 +74,7 @@ class EDIExchangeRecord(models.Model):
("input_processed_error", "Error on process"),
],
)
exchange_error = fields.Text(readonly=True)
exchange_error = fields.Text(string="Exchange error", readonly=True, copy=False)
# Relations w/ other records
parent_id = fields.Many2one(
comodel_name="edi.exchange.record",
Expand Down
2 changes: 1 addition & 1 deletion edi_oca/models/edi_exchange_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class EDIExchangeType(models.Model):
comodel_name="queue.job.channel",
)
name = fields.Char(required=True)
code = fields.Char(required=True)
code = fields.Char(required=True, copy=False)
direction = fields.Selection(
selection=[("input", "Input"), ("output", "Output")], required=True
)
Expand Down

0 comments on commit 076ad12

Please sign in to comment.