Skip to content

Commit

Permalink
[MIG] hr_employee_ppe: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoRomera committed Sep 12, 2024
1 parent 8665177 commit 3b7e46c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 34 deletions.
2 changes: 1 addition & 1 deletion hr_employee_ppe/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Personal Protective Equipment (PPE) Management",
"version": "14.0.1.0.1",
"version": "17.0.1.0.0",
"author": "Escodoo, Odoo Community Association (OCA)",
"maintainers": ["marcelsavegnago", "eduaparicio"],
"images": ["static/description/banner.png"],
Expand Down
6 changes: 3 additions & 3 deletions hr_employee_ppe/reports/hr_employee_ppe_report_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
t-if="line.is_ppe"
>
<td>
<t t-esc="line.product_id.name" />
<t t-out="line.product_id.name" />
</td>
<td>
<t t-esc="line.quantity" />
<t t-out="line.quantity" />
</td>
<td>
<t t-esc="line.indications" />
<t t-out="line.indications" />
</td>
</tr>
</t>
Expand Down
34 changes: 13 additions & 21 deletions hr_employee_ppe/views/hr_personal_equipment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,37 @@
name="is_ppe"
string="Is PPE"
readonly="1"
attrs="{'invisible':[('is_ppe', '=', False)]}"
invisible="not is_ppe"
/>
</xpath>
<xpath expr="//field[@name='start_date']" position="before">
<field
name="expire_ppe"
string="Expirable"
attrs="{'invisible':[('is_ppe', '=', False)],'readonly': [('state', 'not in', ('draft','accepted'))]}"
invisible="not is_ppe"
readonly="state not in ['draft','accepted']"
/>
</xpath>
<field name="expiry_date" position="attributes">
<attribute name="attrs">
{'invisible':['&amp;', ('state', '!=', 'expired'), ('expire_ppe', '=', False)],'readonly': [('state', 'not in', ('draft','accepted'))]}
</attribute>
<attribute
name="invisible"
>state != 'expired' and (not expire_ppe)</attribute>
<attribute name="readonly">state not in ['draft','accepted']</attribute>
</field>
<xpath expr="//group[@name='date']" position="after">
<group
name="directions_info"
string="PPE Indications"
attrs="{'invisible':[('is_ppe', '=', False)]}"
invisible="not is_ppe"
>
<field
name="indications"
attrs="{'invisible':[('is_ppe', '=', False)]}"
readonly="1"
/>
<field name="indications" invisible="not is_ppe" readonly="1" />
</group>
<group
string="Certification Information"
attrs="{'invisible':[('is_ppe', '=', False)]}"
>
<field
name="issued_by"
attrs="{'invisible':[('is_ppe', '=', False)]}"
readonly="1"
/>
<group string="Certification Information" invisible="not is_ppe">
<field name="issued_by" invisible="not is_ppe" readonly="1" />
<field
name="certification"
attrs="{'invisible':[('is_ppe', '=', False)],'readonly': [('state', 'not in', ('draft','accepted'))]}"
invisible="not is_ppe"
readonly="state not in ['draft','accepted']"
/>
</group>
</xpath>
Expand Down
2 changes: 1 addition & 1 deletion hr_employee_ppe/views/hr_personal_equipment_request.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
name="action_view_ppe_report"
string="Print Receipt of PPE"
groups="hr.group_hr_user"
attrs="{'invisible':['|',('contains_ppe','=',False), ('state', 'not in', ('draft', 'accepted'))]}"
invisible="(not contains_ppe) or state not in ['draft', 'accepted']"
/>
</xpath>
<xpath
Expand Down
15 changes: 7 additions & 8 deletions hr_employee_ppe/views/product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,25 @@
<field
name="is_ppe"
string="Is PPE"
attrs="{'invisible': [('is_personal_equipment', '=', False)]}"
invisible="not is_personal_equipment"
/>
<field
name="indications"
string="PPE Indications"
attrs="{'invisible': [('is_ppe', '=', False)]}"
/>
<field
name="expirable_ppe"
attrs="{'invisible': [('is_ppe', '=', False)]}"
invisible="not is_ppe"
/>
<field name="expirable_ppe" invisible="not is_ppe" />
<field
name="ppe_duration"
string="PPE Duration"
attrs="{'invisible': [('expirable_ppe', '=', False)], 'required': [('expirable_ppe', '!=', False)]}"
invisible="not expirable_ppe"
required="expirable_ppe"
/>
<field
name="ppe_interval_type"
string="PPE Interval Type"
attrs="{'invisible': [('expirable_ppe', '=', False)], 'required': [('expirable_ppe', '!=', False)]}"
invisible="not expirable_ppe"
required="expirable_ppe"
/>
</group>
</page>
Expand Down

0 comments on commit 3b7e46c

Please sign in to comment.