Skip to content

Commit

Permalink
[MIG] partner_identification: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chaule97 committed Oct 10, 2024
1 parent 8917d05 commit 486535f
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 25 deletions.
1 change: 1 addition & 0 deletions partner_identification/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Contributors
- Phuc Tran Thanh <[email protected]>
- Marie Lejeune <[email protected]>
- Nils Coenen <[email protected]>
- Chau Le <[email protected]>

Other credits
-------------
Expand Down
2 changes: 1 addition & 1 deletion partner_identification/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"name": "Partner Identification Numbers",
"category": "Customer Relationship Management",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"depends": ["contacts"],
"data": [
Expand Down
9 changes: 4 additions & 5 deletions partner_identification/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ def _inverse_identification(self, field_name, category_code):
else:
raise ValidationError(
_(
"This {record_name} has multiple IDs of this "
"type ({category_code}), so a write via the "
"{field_name} field is not possible. "
"In order to fix this, please use the IDs tab."
).format(
"This %(record_name)s has multiple IDs of this "
"type (%(category_code)s), so a write via the "
"%(field_name)s field is not possible. "
"In order to fix this, please use the IDs tab.",
record_name=record._name,
category_code=category_code,
field_name=field_name,
Expand Down
12 changes: 8 additions & 4 deletions partner_identification/models/res_partner_id_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@ def validate_id_number(self, id_number):
raise UserError(
_(
"Error when evaluating the id_category "
"validation code: \n {name} \n({error})"
).format(name=self.name, error=e)
"validation code: \n %(name)s \n(%(error)s)",
name=self.name,
error=e,
)
) from e
if eval_context.get("failed", False):
raise ValidationError(
_("{id_name} is not a valid {cat_name} identifier").format(
id_name=id_number.name, cat_name=self.name
_(
"{%(id_name)s is not a valid %(cat_name)s identifier",
id_name=id_number.name,
cat_name=self.name,
)
)
1 change: 1 addition & 0 deletions partner_identification/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
- Phuc Tran Thanh \<<[email protected]>\>
- Marie Lejeune \<<[email protected]>\>
- Nils Coenen \<<[email protected]>\>
- Chau Le \<<[email protected]>\>
1 change: 1 addition & 0 deletions partner_identification/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>Phuc Tran Thanh &lt;<a class="reference external" href="mailto:phuc&#64;trobz.com">phuc&#64;trobz.com</a>&gt;</li>
<li>Marie Lejeune &lt;<a class="reference external" href="mailto:marie.lejeune&#64;acsone.eu">marie.lejeune&#64;acsone.eu</a>&gt;</li>
<li>Nils Coenen &lt;<a class="reference external" href="mailto:nils.coenen&#64;nico-solutions.de">nils.coenen&#64;nico-solutions.de</a>&gt;</li>
<li>Chau Le &lt;<a class="reference external" href="mailto:chaulb&#64;trobz.com">chaulb&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
Expand Down
10 changes: 5 additions & 5 deletions partner_identification/views/res_partner_id_category_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ failed = not id_number.name.startswith(self.code) and True or False
</field>
</record>
<record id="view_partner_id_category_tree" model="ir.ui.view">
<field name="name">res.partner.id_category.tree</field>
<field name="name">res.partner.id_category.list</field>
<field name="model">res.partner.id_category</field>
<field name="type">tree</field>
<field name="type">list</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="code" />
</tree>
</list>
</field>
</record>
<record id="action_partner_id_category" model="ir.actions.act_window">
<field name="name">Partner ID Categories</field>
<field name="res_model">res.partner.id_category</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
<menuitem
action="action_partner_id_category"
Expand Down
17 changes: 7 additions & 10 deletions partner_identification/views/res_partner_id_number_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@
<separator colspan="4" string="Notes" />
<field name="comment" colspan="4" nolabel="1" />
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" />
<field name="activity_ids" />
<field name="message_ids" />
</div>
<!-- Chatter -->
<chatter />
</form>
</field>
</record>
<record id="view_partner_id_numbers_tree" model="ir.ui.view">
<field name="name">res.partner.id_number.tree</field>
<field name="name">res.partner.id_number.list</field>
<field name="model">res.partner.id_number</field>
<field name="type">tree</field>
<field name="type">list</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="partner_id" />
<field name="category_id" />
<field name="name" />
Expand All @@ -42,13 +39,13 @@
<field name="valid_from" />
<field name="valid_until" />
<field name="status" />
</tree>
</list>
</field>
</record>
<record id="action_partner_id_numbers_form" model="ir.actions.act_window">
<field name="name">Partner ID Numbers</field>
<field name="res_model">res.partner.id_number</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
<menuitem
action="action_partner_id_numbers_form"
Expand Down

0 comments on commit 486535f

Please sign in to comment.