mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Checking only one selected sales channel
This commit is contained in:
committed by
Darío Lodeiros
parent
69b9b8a06c
commit
3d49e1377b
@@ -683,3 +683,10 @@ class PmsFolio(models.Model):
|
||||
(line[0].name, line[1]["amount"], line[1]["base"], len(res)) for line in res
|
||||
]
|
||||
return res
|
||||
|
||||
# Check that only one sale channel is selected
|
||||
@api.constrains("agency_id", "channel_type_id")
|
||||
def _check_only_one_channel(self):
|
||||
for record in self:
|
||||
if record.agency_id and record.channel_type_id:
|
||||
raise models.ValidationError(_("There must be only one sale channel"))
|
||||
|
||||
@@ -40,7 +40,9 @@
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<field name="is_agency" />
|
||||
<group>
|
||||
<field name="is_agency" />
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='internal_notes']" position="after">
|
||||
<page
|
||||
|
||||
Reference in New Issue
Block a user