Browse Source

[MIG] partner_firstname: Migration to 14.0

14.0
Luis Torres 4 years ago
parent
commit
ed8274a3e3
  1. 2
      partner_firstname/__manifest__.py
  2. 4
      partner_firstname/exceptions.py
  3. 18
      partner_firstname/views/res_partner.xml

2
partner_firstname/__manifest__.py

@ -6,7 +6,7 @@
{ {
"name": "Partner first name and last name", "name": "Partner first name and last name",
"summary": "Split first name and last name for non company partners", "summary": "Split first name and last name for non company partners",
"version": "13.0.1.0.1",
"version": "14.0.1.0.0",
"author": "Camptocamp, " "author": "Camptocamp, "
"Grupo ESOC Ingeniería de Servicios, " "Grupo ESOC Ingeniería de Servicios, "
"Tecnativa, " "Tecnativa, "

4
partner_firstname/exceptions.py

@ -8,5 +8,5 @@ class EmptyNamesError(exceptions.ValidationError):
value = value or _("No name is set.") value = value or _("No name is set.")
self.record = record self.record = record
self._value = value self._value = value
self.name = _("Error(s) with partner %d's name.") % record.id
self.args = (self.name, value)
self._name = _("Error(s) with partner %d's name.") % record.id
self.args = (self._name, value)

18
partner_firstname/views/res_partner.xml

@ -7,10 +7,12 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<data> <data>
<xpath expr="//field[@name='name']" position="attributes"> <xpath expr="//field[@name='name']" position="attributes">
<attribute name="attrs">{
<attribute name="attrs">
{
'readonly': [('is_company', '=', False)], 'readonly': [('is_company', '=', False)],
'required': [('is_company', '=', True)] 'required': [('is_company', '=', True)]
}</attribute>
}
</attribute>
</xpath> </xpath>
<xpath expr="//h1//field[@name='name']/.." position="before"> <xpath expr="//h1//field[@name='name']/.." position="before">
<group attrs="{'invisible': [('is_company', '=', True)]}"> <group attrs="{'invisible': [('is_company', '=', True)]}">
@ -38,10 +40,12 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<data> <data>
<xpath expr="//field[@name='name']" position="attributes"> <xpath expr="//field[@name='name']" position="attributes">
<attribute name="attrs">{
<attribute name="attrs">
{
'readonly': [('is_company', '=', False)], 'readonly': [('is_company', '=', False)],
'required': [('is_company', '=', True)] 'required': [('is_company', '=', True)]
}</attribute>
}
</attribute>
</xpath> </xpath>
<xpath expr="//h1//field[@name='name']/.." position="after"> <xpath expr="//h1//field[@name='name']/.." position="after">
<div class="oe_edit_only"> <div class="oe_edit_only">
@ -66,10 +70,12 @@
expr="//field[@name='child_ids']/form//field[@name='name']" expr="//field[@name='child_ids']/form//field[@name='name']"
position="attributes" position="attributes"
> >
<attribute name="attrs">{
<attribute name="attrs">
{
'readonly': [('is_company', '=', False)], 'readonly': [('is_company', '=', False)],
'required': [('is_company', '=', True)] 'required': [('is_company', '=', True)]
}</attribute>
}
</attribute>
</xpath> </xpath>
<xpath <xpath
expr="//field[@name='child_ids']/form//field[@name='name']" expr="//field[@name='child_ids']/form//field[@name='name']"

Loading…
Cancel
Save