[FIX] hr_org_chart,hr_expense: fix form UI
This PR adapts the form views since the merge of #100570. task-3002465 closes odoo/odoo#102750 X-original-commit: 03b7ed51d9bb1e0717d21cd6516f98e477a2c926 Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
@@ -129,7 +129,7 @@ class HrExpense(models.Model):
|
||||
date_today = fields.Date.context_today(self.env.user)
|
||||
for expense in self:
|
||||
target_currency = expense.currency_id or self.env.company.currency_id
|
||||
expense.currency_rate = self.env['res.currency']._get_conversion_rate(
|
||||
expense.currency_rate = expense.company_id and self.env['res.currency']._get_conversion_rate(
|
||||
from_currency=target_currency,
|
||||
to_currency=expense.company_currency_id,
|
||||
company=expense.company_id,
|
||||
|
||||
@@ -140,28 +140,34 @@
|
||||
<field name="total_amount_company" invisible="1"/>
|
||||
<field name="duplicate_expense_ids" invisible="1"/>
|
||||
<field name="sheet_is_editable" invisible="1"/>
|
||||
<field name="product_id" required="1" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" context="{'default_can_be_expensed': 1, 'tree_view_ref': 'hr_expense.product_product_expense_tree_view', 'form_view_ref': 'hr_expense.product_product_expense_form_view'}"/>
|
||||
<label for="product_description" string="" attrs="{'invisible': ['|', ('product_description', '=', False), ('product_id', '=', False)]}"/>
|
||||
<div class="o_row" attrs="{'invisible': ['|', ('product_description', '=', False), ('product_id', '=', False)]}">
|
||||
<field name ="product_description" class="fst-italic"/>
|
||||
<field name="currency_rate" invisible="1"/>
|
||||
<label for="product_id"/>
|
||||
<div>
|
||||
<field name="product_id" required="1" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" context="{'default_can_be_expensed': 1, 'tree_view_ref': 'hr_expense.product_product_expense_tree_view', 'form_view_ref': 'hr_expense.product_product_expense_form_view'}" class="w-100"/>
|
||||
<div class="fst-italic" attrs="{'invisible': ['|', ('product_description', '=', False), ('product_id', '=', False)]}">
|
||||
<field name ="product_description"/>
|
||||
</div>
|
||||
</div>
|
||||
<field name="unit_amount" required="1" force_save="1" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}" attrs="{'invisible': [('product_has_cost', '=', False)], 'readonly': ['|', ('sheet_is_editable', '=', False), ('product_has_cost', '=', True)]}"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<label for="quantity" attrs="{'invisible': [('product_has_cost', '=', False)]}"/>
|
||||
<div class="o_row" attrs="{'invisible': [('product_has_cost', '=', False)]}">
|
||||
<field name="quantity" class="oe_inline" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" style="width: auto !important;"/>
|
||||
<field name="product_uom_id" required="1" force_save="1" options="{'no_open': True, 'no_create': True}" class="oe_inline" groups="uom.group_uom"/>
|
||||
<div attrs="{'invisible': [('product_has_cost', '=', False)]}">
|
||||
<field name="quantity" class="d-inline-block" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" style="width: unset !important;"/>
|
||||
<field name="product_uom_id" required="1" force_save="1" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom" style="width: unset !important;"/>
|
||||
|
||||
<field name="total_amount_company" widget='monetary' options="{'currency_field': 'company_currency_id'}"/>
|
||||
</div>
|
||||
|
||||
<label for="total_amount" string="Total" attrs="{'invisible': [('product_has_cost', '=', True)]}"/>
|
||||
<div class="o_row" attrs="{'invisible': [('product_has_cost', '=', True)]}">
|
||||
<field name="total_amount" widget='monetary' options="{'currency_field': 'currency_id'}" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" class="oe_inline"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
</div>
|
||||
<label for="total_amount_company" attrs="{'invisible': [('product_has_cost', '=', False)]}"/>
|
||||
<div class="o_row d-flex" attrs="{'invisible': [('same_currency', '=', True), ('product_has_cost', '=', False)]}">
|
||||
<field name="total_amount_company" style="vertical-align: top;" widget='monetary' options="{'currency_field': 'company_currency_id'}"/>
|
||||
<field name="label_convert_rate"/>
|
||||
<div attrs="{'invisible': [('product_has_cost', '=', True)]}">
|
||||
<div class="row" attrs="{'invisible': [('product_has_cost', '=', True)]}">
|
||||
<field name="total_amount" widget='monetary' options="{'currency_field': 'currency_id'}" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" class="w-50"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency" class="ps-2 w-50"/>
|
||||
</div>
|
||||
<div class="row" attrs="{'invisible': [('same_currency', '=', True), ('product_has_cost', '=', False)]}">
|
||||
<field name="total_amount_company" widget='monetary' options="{'currency_field': 'company_currency_id'}" class="w-lg-50"/>
|
||||
<field name="label_convert_rate" class="ps-0 w-lg-50"/>
|
||||
</div>
|
||||
</div>
|
||||
<label for="tax_ids" attrs="{'invisible': [('product_has_tax', '=', False)]}"/>
|
||||
<div class="d-flex o_row">
|
||||
@@ -203,7 +209,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<div>
|
||||
<field name="description" class="oe_inline" placeholder="Notes..."/>
|
||||
<field name="description" placeholder="Notes..."/>
|
||||
</div>
|
||||
</sheet>
|
||||
<div class="o_attachment_preview"/>
|
||||
@@ -517,7 +523,7 @@
|
||||
<label for="default_code"/>
|
||||
<div>
|
||||
<field name="default_code"/>
|
||||
<i class="text-muted oe_edit_only">Use this reference as a subject prefix when submitting by email.</i>
|
||||
<span class="d-inline-block"><i class="text-muted">Use this reference as a subject prefix when submitting by email.</i></span>
|
||||
</div>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
|
||||
@@ -7,10 +7,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<div id="o_work_employee_main" position="after">
|
||||
<div id="o_employee_right" class="col-lg-4 px-0 ps-lg-5 pe-lg-0">
|
||||
<group>
|
||||
<div class="o_horizontal_separator o_org_chart_title" colspan="2">Organization Chart</div>
|
||||
<field name="child_ids" class="position-relative" widget="hr_org_chart" readonly="1" nolabel="1"/>
|
||||
</group>
|
||||
<separator string="Organization Chart"/>
|
||||
<field name="child_ids" class="position-relative" widget="hr_org_chart" readonly="1" nolabel="1"/>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
@@ -23,10 +21,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@id='o_work_employee_main']" position="after">
|
||||
<div id="o_employee_right" class="col-lg-4 px-0 ps-lg-5">
|
||||
<group>
|
||||
<div class="o_horizontal_separator o_org_chart_title" colspan="2">Organization Chart</div>
|
||||
<field name="child_ids" class="position-relative" widget="hr_org_chart" readonly="1" nolabel="1"/>
|
||||
</group>
|
||||
<separator string="Organization Chart"/>
|
||||
<field name="child_ids" class="position-relative" widget="hr_org_chart" readonly="1" nolabel="1"/>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -39,11 +35,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<div id="o_work_employee_main" position="after">
|
||||
<div id="o_employee_right" class="col-lg-4 px-0 ps-lg-5">
|
||||
<group>
|
||||
<field name="employee_ids" invisible="1"/>
|
||||
<div class="o_horizontal_separator o_org_chart_title" colspan="2">Organization Chart</div>
|
||||
<field name="child_ids" class="position-relative" widget="hr_org_chart" readonly="1" nolabel="1"/>
|
||||
</group>
|
||||
<separator string="Organization Chart"/>
|
||||
<field name="child_ids" class="position-relative" widget="hr_org_chart" readonly="1" nolabel="1"/>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user