Commit d5624d0a authored by Luca Cristaldi's avatar Luca Cristaldi

Add xml record instead of hardcoded string

parent 16b3e7c4
......@@ -111,7 +111,11 @@ class Member(Workflow, ModelSQL, ModelView):
super().__setup__()
t = cls.__table__()
cls._sql_constraints = [
('code_uniq', Unique(t, t.code), 'Member code must be unique.'),
(
'code_uniq',
Unique(t, t.code),
'association.msg_member_code_unique'
),
]
cls._transitions |= {('draft', 'running'), ('running', 'draft'),
......@@ -539,8 +543,11 @@ class Fee(ModelSQL, ModelView):
table = cls.__table__()
cls._sql_constraints = [
('code_uniq', Unique(table, table.member, table.period),
"The periods for each member must be unique.")
(
'code_uniq',
Unique(table, table.member, table.period),
'association.msg_fee_member_period_unique'
),
]
cls._buttons.update({
......
......@@ -16,7 +16,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="text">You cannot expel the member "%(member)s" because there are still some unpaid fees.</field>
</record>
<record model="ir.message" id="msg_period_fee_invalid">
<field name="text">TThe fee amount for period "%(period)s" must be greater than or equal to zero.</field>
<field name="text">The fee amount for period "%(period)s" must be greater than or equal to zero.</field>
</record>
<record model="ir.message" id="msg_party_receivable_missing">
<field name="text">The party "%(party)s" doesn't have an account receivable defined.</field>
......@@ -24,5 +24,11 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.message" id="msg_overlapping_membership">
<field name="text">The membership "%(first)s" overlaps with the period "%(second)s".</field>
</record>
<record model="ir.message" id="msg_member_code_unique">
<field name="text">Member code must be unique.</field>
</record>
<record model="ir.message" id="msg_fee_member_period_unique">
<field name="text">The periods for each member must be unique.</field>
</record>
</data>
</tryton>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment