Skip to content

Commit

Permalink
[MIG] partner_middlename: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Deriman-Alonso committed Jul 3, 2024
1 parent ebeb2a9 commit bf96f82
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 28 deletions.
6 changes: 5 additions & 1 deletion partner_middlename/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Partner Middle Name
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f407050c966c319987c0347ba93ce0a90932ed250921016146f1a14b80c9dfca
!! source digest: sha256:675b524f2d46fb9cdc7b361aa6855acbe759bdc1ab8a02ccb684897383cb03e6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -83,6 +83,10 @@ Contributors
- Daniel Reis <dreis@opensourceintegrators.com>
- Nikul Chaudhary <nchaudhary@opensourceintegrators.com>

- `Binhex Systems Solutions <https://binhex.cloud/>`__:

- Deriman Alonso <d.alonso@binhex.cloud>

Maintainers
-----------

Expand Down
1 change: 1 addition & 0 deletions partner_middlename/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"author": "Open Source Integrators, " "Odoo Community Association (OCA)",
"category": "Partner Management",
"depends": ["partner_firstname"],
"excludes" : ["partner_second_lastname"],
"data": ["views/res_partner.xml", "views/res_user.xml"],
"installable": True,
}
2 changes: 2 additions & 0 deletions partner_middlename/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- [Open Source Integrators](https://www.opensourceintegrators.com):
- Daniel Reis \<<dreis@opensourceintegrators.com>\>
- Nikul Chaudhary \<<nchaudhary@opensourceintegrators.com>\>
- [Binhex Systems Solutions](https://binhex.cloud/):
- Deriman Alonso \<<d.alonso@binhex.cloud>\>
6 changes: 5 additions & 1 deletion partner_middlename/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Partner Middle Name</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f407050c966c319987c0347ba93ce0a90932ed250921016146f1a14b80c9dfca
!! source digest: sha256:675b524f2d46fb9cdc7b361aa6855acbe759bdc1ab8a02ccb684897383cb03e6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/partner-contact/tree/17.0/partner_middlename"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_middlename"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Allows to enter contact names using three separate fields, for First
Expand Down Expand Up @@ -429,6 +429,10 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Nikul Chaudhary &lt;<a class="reference external" href="mailto:nchaudhary&#64;opensourceintegrators.com">nchaudhary&#64;opensourceintegrators.com</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://binhex.cloud/">Binhex Systems Solutions</a>:<ul>
<li>Deriman Alonso &lt;<a class="reference external" href="mailto:d.alonso&#64;binhex.cloud">d.alonso&#64;binhex.cloud</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
36 changes: 15 additions & 21 deletions partner_middlename/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@
<field name="inherit_id" ref="partner_firstname.view_partner_simple_form" />
<field name="arch" type="xml">
<field name="firstname" position="attributes">
<attribute name="attrs">
{'required': [('lastname', '=', False), ('middlename', '=', False),
('is_company', '=', False), ('type', '=', 'contact')]}
<attribute name="required">
lastname == False and middlename == False and is_company == False and type == 'contact'
</attribute>
</field>
<field name="lastname" position="attributes">
<attribute name="attrs">
{'required': [('firstname', '=', False), ('middlename', '=', False),
('is_company', '=', False), ('type', '=', 'contact')]}
<attribute name="required">
firstname == False and middlename == False and is_company == False and type == 'contact'
</attribute>
</field>
<field name="lastname" position="before">
<field
name="middlename"
attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"
required="firstname == False and lastname == False and is_company == False and type == 'contact'"
/>
</field>
</field>
Expand All @@ -30,40 +28,36 @@
<field name="arch" type="xml">
<!-- Main form -->
<field name="firstname" position="attributes">
<attribute name="attrs">
{'required': [('lastname', '=', False), ('middlename', '=', False),
('is_company', '=', False), ('type', '=', 'contact')]}
<attribute name="required">
lastname == False and middlename == False and is_company == False and type == 'contact'
</attribute>
</field>
<field name="lastname" position="attributes">
<attribute name="attrs">
{'required': [('firstname', '=', False), ('middlename', '=', False),
('is_company', '=', False), ('type', '=', 'contact')]}
<attribute name="required">
firstname == False and middlename == False and is_company == False and type == 'contact'
</attribute>
</field>
<field name="lastname" position="before">
<field
name="middlename"
attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"
required="firstname == False and lastname == False and is_company == False and type == 'contact'"
/>
</field>
<!-- Inner contact form of child_ids -->
<xpath
expr="//field[@name='child_ids']/form//field[@name='firstname']"
position="attributes"
>
<attribute name="attrs">
{'required': [('lastname', '=', False), ('middlename', '=', False),
('is_company', '=', False), ('type', '=', 'contact')]}
<attribute name="required">
lastname == False and middlename == False and is_company == False and type == 'contact'
</attribute>
</xpath>
<xpath
expr="//field[@name='child_ids']/form//field[@name='lastname']"
position="attributes"
>
<attribute name="attrs">
{'required': [('firstname', '=', False), ('middlename', '=', False),
('is_company', '=', False), ('type', '=', 'contact')]}
<attribute name="required">
firstname == False and middlename == False and is_company == False and type == 'contact'
</attribute>
</xpath>
<xpath
Expand All @@ -72,7 +66,7 @@
>
<field
name="middlename"
attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"
required="firstname == False and lastname == False and is_company == False and type == 'contact'"
/>
</xpath>
</field>
Expand Down
10 changes: 5 additions & 5 deletions partner_middlename/views/res_user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<field name="inherit_id" ref="partner_firstname.view_users_form" />
<field name="arch" type="xml">
<field name="firstname" position="attributes">
<attribute name="attrs">
{'required': [('lastname', '=', False), ('middlename', '=', False)]}
<attribute name="required">
lastname == False and middlename == False
</attribute>
</field>
<field name="lastname" position="attributes">
<attribute name="attrs">
{'required': [('firstname', '=', False), ('middlename', '=', False)]}
<attribute name="required">
firstname == False and middlename == False
</attribute>
</field>
<field name="lastname" position="before">
<field
name="middlename"
attrs="{'required': [('firstname', '=', False), ('lastname', '=', False)]}"
required="firstname == False and lastname == False"
/>
</field>
</field>
Expand Down

0 comments on commit bf96f82

Please sign in to comment.