[REF] base,all: Update modifier syntax: prepare view migration
These changes are made as a result of simplifying attrs and 'states' in views. Before applying the migration script, it is necessary to fix some views. These views are erroneous and either work by chance or are simply untested. We have for example wrong domains, elements used by modifiers but not present in the view, obsolete domain operators, inherit views not targeting the right views, xpaths using attributes as target, the use of %(...)s in views, false attribute value types in python. Part-of: odoo/odoo#104741
This commit is contained in:
@@ -618,7 +618,7 @@
|
||||
<button name="button_cancel" string="Cancel Entry" type="object" groups="account.group_account_invoice" data-hotkey="x"
|
||||
attrs="{'invisible' : ['|', '|', ('id', '=', False), ('state', '!=', 'draft'),('move_type', '!=', 'entry')]}"/>
|
||||
<button name="button_cancel" string="Cancel" type="object" groups="account.group_account_invoice" data-hotkey="x"
|
||||
attrs="{'invisible' : ['|', '|', ('id', '=', False), ('state', '!=', 'draft'),('move_type', '==', 'entry')]}"/>
|
||||
attrs="{'invisible' : ['|', '|', ('id', '=', False), ('state', '!=', 'draft'),('move_type', '=', 'entry')]}"/>
|
||||
<button name="button_draft" string="Reset to Draft" type="object" groups="account.group_account_invoice"
|
||||
attrs="{'invisible' : [('show_reset_to_draft_button', '=', False)]}" data-hotkey="r" />
|
||||
<button string="Request Cancel"
|
||||
@@ -741,6 +741,7 @@
|
||||
|
||||
<!-- Invisible fields -->
|
||||
<field name="id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="show_name_warning" invisible="1"/>
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
string="Assign Leads"
|
||||
class="oe_highlight"
|
||||
confirm="This will assign leads to all members. Do you want to proceed?"
|
||||
attrs="{'invisible': ['|', '&', ('use_leads', '=', False), ('use_opportunities', '=', False), ('assignment_enabled', '=', False)]}"/>
|
||||
invisible="not use_leads and not use_opportunities or not assignment_enabled"/>
|
||||
</header>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='options_active']" position="inside">
|
||||
|
||||
@@ -44,7 +44,7 @@ class PriceRule(models.Model):
|
||||
currency_id = fields.Many2one(related='carrier_id.currency_id')
|
||||
|
||||
variable = fields.Selection(selection=VARIABLE_SELECTION, required=True, default='quantity')
|
||||
operator = fields.Selection([('==', '='), ('<=', '<='), ('<', '<'), ('>=', '>='), ('>', '>')], required=True, default='<=')
|
||||
operator = fields.Selection([('=', '='), ('<=', '<='), ('<', '<'), ('>=', '>='), ('>', '>')], required=True, default='<=')
|
||||
max_value = fields.Float('Maximum Value', required=True)
|
||||
list_base_price = fields.Float(string='Sale Base Price', digits='Product Price', required=True, default=0.0)
|
||||
list_price = fields.Float('Sale Price', digits='Product Price', required=True, default=0.0)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<field name="name">res.config.settings.view.form.inherit.event</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="priority" eval="65"/>
|
||||
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
|
||||
<field name="inherit_id" ref="mail.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form" position="inside">
|
||||
<app data-string="Events" string="Events" name="event" groups="event.group_event_manager">
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<span class="o_stat_text">Sale Order</span>
|
||||
</div>
|
||||
</button>
|
||||
<field name="sale_order_id" invisible="1"/>
|
||||
</div>
|
||||
<div name="button_box" position="after">
|
||||
<field name="is_paid" invisible="1"/>
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<span class="o_stat_text">Sale Order</span>
|
||||
</div>
|
||||
</button>
|
||||
<field name="sale_order_id" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//group" position="before">
|
||||
<field name="is_paid" invisible="1"/>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<group name="calendar_accounts" position="inside">
|
||||
<group string="Google Calendar">
|
||||
<group class="text-break">
|
||||
<field name="google_calendar_rtoken" readonly="1"/>
|
||||
<field name="google_calendar_rtoken" readonly="1" groups="base.group_system"/>
|
||||
<field name="google_calendar_token" readonly="1"/>
|
||||
<field name="google_calendar_token_validity" readonly="1"/>
|
||||
<field name="google_calendar_sync_token" readonly="1"/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.google_gmail</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
|
||||
<field name="inherit_id" ref="mail.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div id="msg_module_google_gmail" position="replace">
|
||||
<div class="row mt16" id="gmail_client_identifier">
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
<record id="hr_job_search_view" model="ir.ui.view">
|
||||
<field name="name">hr.job.search</field>
|
||||
<field name="model">hr.job</field>
|
||||
<field name="inherit_id" ref="hr.view_job_filter" />
|
||||
<field name="inherit_id" ref="hr_recruitment.view_job_filter_recruitment" />
|
||||
<field name="priority">20</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//filter[@name='my_favorite_jobs']" position="after">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="inherit_id" ref="account.view_account_position_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="auto_apply" position="after">
|
||||
<field name="l10n_br_fp_type" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('country_id', '!=', %(base.br)d)]}"/>
|
||||
<field name="l10n_br_fp_type" options="{'no_open': True, 'no_create': True}" invisible="country_id != %(base.br)d"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='vat']" position="after">
|
||||
<field name="l10n_br_cpf_code" attrs="{'invisible': [('country_id', '!=', %(base.br)d)]}"/>
|
||||
<field name="l10n_br_ie_code" attrs="{'invisible': [('country_id', '!=', %(base.br)d)]}"/>
|
||||
<field name="l10n_br_im_code" attrs="{'invisible': [('country_id', '!=', %(base.br)d)]}"/>
|
||||
<field name="l10n_br_nire_code" attrs="{'invisible': [('country_id', '!=', %(base.br)d)]}"/>
|
||||
<field name="l10n_br_cpf_code" invisible="country_id != %(base.br)d"/>
|
||||
<field name="l10n_br_ie_code" invisible="country_id != %(base.br)d"/>
|
||||
<field name="l10n_br_im_code" invisible="country_id != %(base.br)d"/>
|
||||
<field name="l10n_br_nire_code" invisible="country_id != %(base.br)d"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<field name="inherit_id" ref="base.view_company_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="vat" position="after">
|
||||
<field name="l10n_cl_activity_description" placeholder="Activity Description" attrs="{'invisible': [('country_id', '!=', %(base.cl)d)], 'required': [('country_id', '=', %(base.cl)d)]}"/>
|
||||
<field name="l10n_cl_activity_description" placeholder="Activity Description"
|
||||
invisible="country_id != %(base.cl)d"
|
||||
required="country_id == %(base.cl)d"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div attrs="{'invisible': [('same_vat_partner_id', '=', False)]}" position="after">
|
||||
<div name="warning_tax" position="after">
|
||||
<div class="alert alert-warning" role="alert" attrs="{'invisible': [('l10n_ec_vat_validation', '=', False)]}">
|
||||
<field name="l10n_ec_vat_validation"/>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="inherit_id" ref="base.view_country_state_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="code" position="after">
|
||||
<field name="l10n_in_tin" attrs="{'invisible': [('country_id', '!=', %(base.in)d)]}"/>
|
||||
<field name="l10n_in_tin" invisible="country_id != %(base.in)d"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<group name="ewaybill_group">
|
||||
<group string="Transaction Details" name="Transaction_group"
|
||||
attrs="{'invisible': [('l10n_in_edi_ewaybill_direct_api', '!=', True)]}">
|
||||
<field name="l10n_in_type_id" domain="[('allowed_supply_type', 'in', ('in', 'both')) if move_type in ('in_invoice', 'in_refund', 'in_receipt') else ('allowed_supply_type', 'in', ('out', 'both'))]"/>
|
||||
<field name="l10n_in_type_id" domain="[('allowed_supply_type', 'in', ('in', 'both'))] if move_type in ('in_invoice', 'in_refund', 'in_receipt') else [('allowed_supply_type', 'in', ('out', 'both'))]"/>
|
||||
</group>
|
||||
<group string="Transportation Details" name="transportation_group">
|
||||
<field name="l10n_in_mode"/>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_send_mail']" position="after">
|
||||
<button string="Send Mass Mailing" name="action_send_mail" type="object" class="btn-primary o_mail_send"
|
||||
attrs="{'invisible': ['|', ('mass_mailing_name', '==', ''), ('mass_mailing_name', '==', False)]}" data-hotkey="q"/>
|
||||
attrs="{'invisible': ['|', ('mass_mailing_name', '=', ''), ('mass_mailing_name', '=', False)]}" data-hotkey="q"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -438,7 +438,7 @@
|
||||
<field name="move_lines_count" invisible="1"/>
|
||||
<field name="state" invisible="1" force_save="1"/>
|
||||
<field name="product_uom_qty" string="To Produce" force_save="1" attrs="{'readonly': ['&', ('parent.state', '!=', 'draft'), '|', '&', ('parent.state', 'not in', ('confirmed', 'progress', 'to_close')), ('parent.is_planned', '!=', True), ('parent.is_locked', '=', True)]}"/>
|
||||
<field name="quantity_done" string="Produced" attrs="{'column_invisible': [('parent.state', '=', 'draft')], 'readonly': [('has_tracking', '=', True)]}"/>
|
||||
<field name="quantity_done" string="Produced" attrs="{'column_invisible': [('parent.state', '=', 'draft')], 'readonly': [('has_tracking', '!=', 'none')]}"/>
|
||||
<field name="product_uom" groups="uom.group_uom"/>
|
||||
<field name="cost_share" optional="hide"/>
|
||||
<field name="show_details_visible" invisible="1"/>
|
||||
|
||||
@@ -16,7 +16,7 @@ class PaymentMethod(models.Model):
|
||||
string="Image",
|
||||
max_width=64,
|
||||
max_height=64,
|
||||
required="True",
|
||||
required=True,
|
||||
help="This field holds the image used for this payment method, limited to 64x64 px")
|
||||
image_payment_form = fields.Image(
|
||||
string="Image displayed on the payment form", related='image', store=True, max_width=45,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<group>
|
||||
<field name="account_readonly" invisible="1" />
|
||||
<field name="amount_to_balance" readonly="1" />
|
||||
<field name="account_id" attrs="{'readonly': [('account_readonly', '==', True)]}"/>
|
||||
<field name="account_id" attrs="{'readonly': [('account_readonly', '=', True)]}"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="close_session" string="Close Session" type="object" class="btn-primary" data-hotkey="q"/>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<div class="d-flex flex-column align-items-start w-50">
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<field name="pos_self_order_image_name" invisible ="1"/>
|
||||
<field name="pos_self_order_image_name"/>
|
||||
<label for="pos_self_order_image" string="Set Background Image"/>
|
||||
<field name="pos_self_order_image" class="w-75" filename="pos_self_order_image_name"/>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Product">
|
||||
<header>
|
||||
<button string="Print Labels" type="object" name="action_open_label_layout" attrs="{'invisible': [('detailed_type', '==', 'service')]}"/>
|
||||
<button string="Print Labels" type="object" name="action_open_label_layout" attrs="{'invisible': [('detailed_type', '=', 'service')]}"/>
|
||||
</header>
|
||||
<sheet name="product_form">
|
||||
<field name='product_variant_count' invisible='1'/>
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
<field name="company_id" optional="show" groups="base.group_multi_company" options="{'no_create': True, 'no_open': True}"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<!-- XBO: required modifiers contains a falsy domain to be able to display the daterange without any button to set the date_end -->
|
||||
<field name="date_start" string="Planned Date" widget="daterange" options="{'end_date_field': 'date'}" attrs="{'required': [(1, '=', 0)]}" optional="hide"/>
|
||||
<field name="date_start" string="Planned Date" widget="daterange" options="{'end_date_field': 'date'}" required="False" optional="hide"/>
|
||||
<field name="date" invisible="1" />
|
||||
<field name="user_id" optional="show" string="Project Manager" widget="many2one_avatar_user" options="{'no_open':True, 'no_create': True, 'no_create_edit': True}"/>
|
||||
<field name="last_update_color" invisible="1"/>
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
<footer>
|
||||
<button string="Archive Stages" type="object" name="action_archive" class="btn btn-primary" attrs="{'invisible': ['|', ('stages_active', '=', False), ('projects_count', '=', 0)]}" data-hotkey="q"/>
|
||||
<button string="Delete" type="object" name="action_unlink" class="btn btn-primary" attrs="{'invisible': [('projects_count', '>', 0)]}" data-hotkey="w"/>
|
||||
<button string="Discard" special="cancel" data-hotkey="x" t-att-class="stages_active or projects_count ? '' : 'btn btn-primary'" />
|
||||
<button string="Discard" special="cancel" data-hotkey="x" class="btn btn-primary" invisible="not (stages_active or projects_count)" />
|
||||
<button string="Discard" special="cancel" data-hotkey="x" invisible="stages_active or projects_count" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree/field[@name='product_id']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
<attribute name="column_invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//tree/field[@name='product_id']" position="after">
|
||||
<field name="product_template_id"
|
||||
@@ -19,9 +19,9 @@
|
||||
width="35%"
|
||||
context="{'partner_id': parent.partner_id}"
|
||||
widget="pol_product_many2one"/>
|
||||
<field name="product_template_attribute_value_ids" invisible="1"/>
|
||||
<field name="product_no_variant_attribute_value_ids" invisible="1"/>
|
||||
<field name="is_configurable_product" invisible="1"/>
|
||||
<field name="product_template_attribute_value_ids" column_invisible="1"/>
|
||||
<field name="product_no_variant_attribute_value_ids" column_invisible="1"/>
|
||||
<field name="is_configurable_product" column_invisible="1"/>
|
||||
</xpath>
|
||||
<field name="partner_id" position="after">
|
||||
<field name="grid" invisible="1"/>
|
||||
|
||||
@@ -241,9 +241,11 @@
|
||||
<button id="create_invoice_percentage" name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
|
||||
type="action" context="{'default_advance_payment_method': 'percentage'}" data-hotkey="c"
|
||||
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
|
||||
<button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="btn-primary" data-hotkey="g" context="{'validate_analytic': True}"/>
|
||||
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice"
|
||||
groups="sale.group_proforma_sales" class="btn-primary"
|
||||
<button name="action_quotation_send" id="send_by_email_primary" string="Send by Email" type="object" data-hotkey="g"
|
||||
invisible="state != 'draft'" class="btn-primary"
|
||||
context="{'validate_analytic': True}"/>
|
||||
<button name="action_quotation_send" id="send_proforma_primary" type="object" string="Send PRO-FORMA Invoice" class="btn-primary"
|
||||
groups="sale.group_proforma_sales"
|
||||
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('invoice_count','>=',1)]}" context="{'proforma': True, 'validate_analytic': True}"/>
|
||||
<button name="action_confirm" id="action_confirm" data-hotkey="q"
|
||||
string="Confirm" class="btn-primary" type="object" context="{'validate_analytic': True}"
|
||||
@@ -251,8 +253,8 @@
|
||||
<button name="action_confirm" data-hotkey="q"
|
||||
string="Confirm" type="object" context="{'validate_analytic': True}"
|
||||
attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
|
||||
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice" groups="sale.group_proforma_sales" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('invoice_count','>=',1)]}" context="{'proforma': True, 'validate_analytic': True}"/>
|
||||
<button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale" data-hotkey="g" context="{'validate_analytic': True}"/>
|
||||
<button name="action_quotation_send" id="send_proforma" type="object" string="Send PRO-FORMA Invoice" groups="sale.group_proforma_sales" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('invoice_count','>=',1)]}" context="{'proforma': True, 'validate_analytic': True}"/>
|
||||
<button name="action_quotation_send" id="send_by_email" string="Send by Email" type="object" states="sent,sale" data-hotkey="g" context="{'validate_analytic': True}"/>
|
||||
|
||||
<!-- allow to unlock locked orders even if setting is not enabled (e.g. orders synchronized from connectors) -->
|
||||
<button name="action_unlock" type="object" string="Unlock"
|
||||
@@ -523,7 +525,7 @@
|
||||
'uom': product_uom,
|
||||
'company_id': parent.company_id
|
||||
}"
|
||||
attrs="{'readonly': [('is_downpayment', '==', True)]}"
|
||||
attrs="{'readonly': [('is_downpayment', '=', True)]}"
|
||||
/>
|
||||
<field
|
||||
name="qty_delivered"
|
||||
@@ -562,7 +564,7 @@
|
||||
<field
|
||||
name="customer_lead"
|
||||
optional="hide"
|
||||
attrs="{'readonly': ['|', ('parent.state', 'not in', ['draft', 'sent', 'sale']), ('is_downpayment', '==', True)]}"
|
||||
attrs="{'readonly': ['|', ('parent.state', 'not in', ['draft', 'sent', 'sale']), ('is_downpayment', '=', True)]}"
|
||||
/>
|
||||
<field name="product_packaging_qty" attrs="{'invisible': ['|', ('product_id', '=', False), ('product_packaging_id', '=', False)]}" groups="product.group_stock_packaging" optional="show"/>
|
||||
<field name="product_packaging_id" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" groups="product.group_stock_packaging" optional="show"/>
|
||||
@@ -576,7 +578,7 @@
|
||||
options="{'no_create': True}"
|
||||
domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id), ('country_id', '=', parent.tax_country_id)]"
|
||||
context="{'active_test': True}"
|
||||
attrs="{'readonly': ['|', ('qty_invoiced', '>', 0), ('is_downpayment', '==', True)]}"
|
||||
attrs="{'readonly': ['|', ('qty_invoiced', '>', 0), ('is_downpayment', '=', True)]}"
|
||||
optional="show"
|
||||
/>
|
||||
<field name="discount" string="Disc.%" groups="product.group_discount_per_so_line" optional="show" widget="sol_discount"/>
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree/field[@name='product_template_id']" position="attributes">
|
||||
<attribute name="invisible">0</attribute>
|
||||
<attribute name="column_invisible">0</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//tree/field[@name='product_template_id']" position="after">
|
||||
<field name="product_template_attribute_value_ids" invisible="1" />
|
||||
<field name="product_custom_attribute_value_ids" invisible="1" >
|
||||
<field name="product_template_attribute_value_ids" column_invisible="1" />
|
||||
<field name="product_custom_attribute_value_ids" column_invisible="1" >
|
||||
<tree>
|
||||
<field name="custom_product_template_attribute_value_id" />
|
||||
<field name="custom_value" />
|
||||
</tree>
|
||||
</field>
|
||||
<field name="product_no_variant_attribute_value_ids" invisible="1" />
|
||||
<field name="is_configurable_product" invisible="1" />
|
||||
<field name="product_no_variant_attribute_value_ids" column_invisible="1" />
|
||||
<field name="is_configurable_product" column_invisible="1" />
|
||||
</xpath>
|
||||
<xpath expr="//tree/field[@name='product_id']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<field name="name">project.task.form.inherit.timesheet</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="priority">600</field>
|
||||
<field name="inherit_id" ref="project.project_sharing_project_task_view_form"/>
|
||||
<field name="inherit_id" ref="hr_timesheet.project_sharing_inherit_project_task_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='timesheet_ids']/tree" position="attributes">
|
||||
<attribute name="decoration-muted">timesheet_invoice_id != False</attribute>
|
||||
|
||||
@@ -315,7 +315,7 @@
|
||||
</button>
|
||||
<button type="object"
|
||||
name="action_view_orderpoints"
|
||||
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
|
||||
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '=', 1)]}"
|
||||
class="oe_stat_button" icon="fa-refresh">
|
||||
<field name="nbr_reordering_rules" widget="statinfo"/>
|
||||
</button>
|
||||
@@ -438,7 +438,7 @@
|
||||
</button>
|
||||
<button type="object"
|
||||
name="action_view_orderpoints"
|
||||
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
|
||||
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '=', 1)]}"
|
||||
class="oe_stat_button"
|
||||
icon="fa-refresh">
|
||||
<field name="nbr_reordering_rules" widget="statinfo"/>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<field name="pick_ids" invisible="1"/>
|
||||
|
||||
<field name="show_transfers" invisible="1"/>
|
||||
<field name="backorder_confirmation_line_ids" nolabel="1" attrs="{'invisible': [('show_transfers', '=', False)]}">>
|
||||
<field name="backorder_confirmation_line_ids" nolabel="1" attrs="{'invisible': [('show_transfers', '=', False)]}">
|
||||
<tree create="0" delete="0" editable="top">
|
||||
<field name="picking_id"/>
|
||||
<field name="to_backorder" widget="boolean_toggle"/>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<field name="pick_ids" invisible="1"/>
|
||||
|
||||
<field name="show_transfers" invisible="1"/>
|
||||
<field name="immediate_transfer_line_ids" nolabel="1" attrs="{'invisible': [('show_transfers', '=', False)]}">>
|
||||
<field name="immediate_transfer_line_ids" nolabel="1" attrs="{'invisible': [('show_transfers', '=', False)]}">
|
||||
<tree create="0" delete="0" editable="top">
|
||||
<field name="picking_id"/>
|
||||
<field name="to_immediate" widget="boolean_toggle"/>
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
<xpath expr="/form/header/button[last()]" position="after">
|
||||
<button name="print_return_label" string="Print Return Label" type="object" attrs="{'invisible':['|', '|', ('is_return_picking', '=', False),('state', '=', 'done'),('picking_type_code', '!=', 'incoming')]}" data-hotkey="shift+o"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='partner_id']" position="attributes">
|
||||
<attribute name="attrs">{'required': ['&', ('delivery_type', '!=', False), ('delivery_type', 'not in', ['fixed', 'base_on_rule'])]}</attribute>
|
||||
</xpath>
|
||||
</data>
|
||||
<xpath expr="//field[@name='partner_id']" position="attributes">
|
||||
<attribute name="attrs">{'required': ['&', ('delivery_type', '!=', False), ('delivery_type', 'not in', ['fixed', 'base_on_rule'])]}</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class TestLifoPrice(ValuationReconciliationTestCommon):
|
||||
product_form.detailed_type = 'product'
|
||||
product_form.categ_id = product_category_001
|
||||
# <field name="list_price" position="attributes">
|
||||
# <attribute name="attrs">{'readonly': [('product_variant_count', '>', 1)]}</attribute>
|
||||
# <attribute name="readonly">product_variant_count > 1</attribute>
|
||||
# <attribute name="invisible">1</attribute>
|
||||
# </field>
|
||||
# <field name="list_price" position="after">
|
||||
|
||||
@@ -22,7 +22,7 @@ class TestProcurementException(common.TransactionCase):
|
||||
product_form = Form(self.env['product.product'])
|
||||
product_form.name = 'product with no seller'
|
||||
# <field name="list_price" position="attributes">
|
||||
# <attribute name="attrs">{'readonly': [('product_variant_count', '>', 1)]}</attribute>
|
||||
# <attribute name="readonly">product_variant_count > 1</attribute>
|
||||
# <attribute name="invisible">1</attribute>
|
||||
# </field>
|
||||
# <field name="list_price" position="after">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<t t-name='multi_url'>
|
||||
<div>
|
||||
<a id='get' href="/get">get</a>
|
||||
<form id='post' action="/post">post</form>>
|
||||
<form id='post' action="/post">post</form>
|
||||
<a id='get_post' href="/get_post">get_post</a>
|
||||
<a id='get_post_nomultilang' href="/get_post_nomultilang">get_post_nomultilang</a>
|
||||
</div>
|
||||
|
||||
@@ -49,21 +49,19 @@
|
||||
<field name="is_abandoned_cart" invisible="1"/>
|
||||
<field name="cart_recovery_email_sent" invisible="1"/>
|
||||
</field>
|
||||
<xpath expr="//button[@name='action_quotation_send' and @states='draft']" position="attributes">
|
||||
<!-- The '| and the '&' opertors are necessary because draft state of the parent concatenate the domain -->
|
||||
<attribute name="attrs">{'invisible': ['|','&',('is_abandoned_cart', '=', True), ('cart_recovery_email_sent', '=', False)]}</attribute>
|
||||
</xpath>
|
||||
<button name="action_quotation_send" position="after">
|
||||
<button name="action_recovery_email_send" data-hotkey="l"
|
||||
string="Send a Recovery Email"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
attrs="{'invisible': ['|', ('is_abandoned_cart', '=', False), ('cart_recovery_email_sent', '=', True)]}"/>
|
||||
<button name="action_quotation_send" id="send_by_email_primary" position="attributes">
|
||||
<attribute name="invisible">state != 'draft' or (is_abandoned_cart and not cart_recovery_email_sent)</attribute>
|
||||
</button>
|
||||
<button name="action_quotation_send" position="after">
|
||||
<button name="action_recovery_email_send" type="object" id="send_recovery" data-hotkey="l"
|
||||
string="Send a Recovery Email"
|
||||
class="btn-primary"
|
||||
invisible="not is_abandoned_cart or cart_recovery_email_sent"/>
|
||||
</button>
|
||||
<button name="action_quotation_send" id="send_by_email" position="after">
|
||||
<button name="action_quotation_send" id="send_by_email_bis" string="Send by Email" type="object"
|
||||
invisible="not is_abandoned_cart or cart_recovery_email_sent or state != 'draft'"/>
|
||||
</button>
|
||||
<xpath expr="//button[@name='action_quotation_send' and @states='sent,sale']" position="after">
|
||||
<button name="action_quotation_send" string="Send by Email" type="object"
|
||||
attrs="{'invisible': ['|', '|', ('is_abandoned_cart', '=', False), ('cart_recovery_email_sent', '=', True), ('state', '!=', 'draft')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -1443,7 +1443,7 @@ class GroupsView(models.Model):
|
||||
# and is therefore removed when not in debug mode.
|
||||
xml0.append(E.field(name=field_name, invisible="1", on_change="1"))
|
||||
user_type_field_name = field_name
|
||||
user_type_readonly = str({'readonly': [(user_type_field_name, '!=', group_employee.id)]})
|
||||
user_type_readonly = f'{user_type_field_name} != {group_employee.id}'
|
||||
attrs['widget'] = 'radio'
|
||||
# Trigger the on_change of this "virtual field"
|
||||
attrs['on_change'] = '1'
|
||||
@@ -1453,7 +1453,7 @@ class GroupsView(models.Model):
|
||||
elif kind == 'selection':
|
||||
# application name with a selection field
|
||||
field_name = name_selection_groups(gs.ids)
|
||||
attrs['attrs'] = user_type_readonly
|
||||
attrs['readonly'] = user_type_readonly
|
||||
attrs['on_change'] = '1'
|
||||
if category_name not in xml_by_category:
|
||||
xml_by_category[category_name] = []
|
||||
@@ -1469,7 +1469,7 @@ class GroupsView(models.Model):
|
||||
app_name = app.name or 'Other'
|
||||
xml4.append(E.separator(string=app_name, **attrs))
|
||||
left_group, right_group = [], []
|
||||
attrs['attrs'] = user_type_readonly
|
||||
attrs['readonly'] = user_type_readonly
|
||||
# we can't use enumerate, as we sometime skip groups
|
||||
group_count = 0
|
||||
for g in gs:
|
||||
@@ -1487,10 +1487,7 @@ class GroupsView(models.Model):
|
||||
xml4.append(E.group(*right_group))
|
||||
|
||||
xml4.append({'class': "o_label_nowrap"})
|
||||
if user_type_field_name:
|
||||
user_type_attrs = {'invisible': [(user_type_field_name, '!=', group_employee.id)]}
|
||||
else:
|
||||
user_type_attrs = {}
|
||||
user_type_invisible = f'{user_type_field_name} != {group_employee.id}' if user_type_field_name else None
|
||||
|
||||
for xml_cat in sorted(xml_by_category.keys(), key=lambda it: it[0]):
|
||||
master_category_name = xml_cat[1]
|
||||
@@ -1501,7 +1498,7 @@ class GroupsView(models.Model):
|
||||
'class': "alert alert-warning",
|
||||
'role': "alert",
|
||||
'colspan': "2",
|
||||
'attrs': str({'invisible': [(field_name, '=', False)]})
|
||||
'invisible': f'not {field_name}',
|
||||
})
|
||||
user_group_warning_xml.append(E.label({
|
||||
'for': field_name,
|
||||
@@ -1514,9 +1511,9 @@ class GroupsView(models.Model):
|
||||
xml = E.field(
|
||||
*(xml0),
|
||||
E.group(*(xml1), groups="base.group_no_one"),
|
||||
E.group(*(xml2), attrs=str(user_type_attrs)),
|
||||
E.group(*(xml3), attrs=str(user_type_attrs)),
|
||||
E.group(*(xml4), attrs=str(user_type_attrs), groups="base.group_no_one"), name="groups_id", position="replace")
|
||||
E.group(*(xml2), invisible=user_type_invisible),
|
||||
E.group(*(xml3), invisible=user_type_invisible),
|
||||
E.group(*(xml4), invisible=user_type_invisible, groups="base.group_no_one"), name="groups_id", position="replace")
|
||||
xml.addprevious(etree.Comment("GENERATED AUTOMATICALLY BY GROUPS"))
|
||||
|
||||
# serialize and update the view
|
||||
|
||||
@@ -321,7 +321,7 @@
|
||||
help="Remove 'More' top-menu contextual action related to this action"/>
|
||||
<button name="run" string="Run" type="object"
|
||||
class="btn-primary"
|
||||
attrs="{'invisible':['|', ('model_id', '!=', %(base.model_ir_actions_server)s), ('state', '!=', 'code')]}"
|
||||
attrs="{'invisible':['|', ('model_name', '!=', 'ir.actions.server'), ('state', '!=', 'code')]}"
|
||||
help="Run this action manually."/>
|
||||
</header>
|
||||
<sheet>
|
||||
@@ -507,7 +507,7 @@ env['res.partner'].create({'name': partner_name})
|
||||
<field name="name">ir.actions.todo.select</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Actions">
|
||||
<filter string="To Do" name="todo" domain=" [('state','=','open')]" help="Wizards to be Launched"/>
|
||||
<filter string="To Do" name="todo" domain="[('state','=','open')]" help="Wizards to be Launched"/>
|
||||
<field name="action_id"/>
|
||||
<field name="state"/>
|
||||
</search>
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
<button type="object" class="btn btn-primary btn-sm" name="button_immediate_install" states="uninstalled" t-if="! record.to_buy.raw_value" groups="base.group_system">Activate</button>
|
||||
<div t-if="installed" class="d-flex align-items-center text-muted float-start">Installed</div>
|
||||
<a t-att-href="record.website.raw_value" target="_blank" attrs="{'invisible':[('website', 'in', (False, ''))]}" class="btn btn-sm btn-secondary float-end o-hidden-ios" role="button">Learn More</a>
|
||||
<a type="edit" class="btn btn-secondary btn-sm float-end" role="button" attrs="{'invisible': [('website', '<>', '')]}">Module Info</a>
|
||||
<a type="edit" class="btn btn-secondary btn-sm float-end" role="button" attrs="{'invisible': [('website', '!=', '')]}">Module Info</a>
|
||||
<a href="https://odoo.com/pricing?utm_source=db&utm_medium=module#hosting=on_premise" target="_blank" class="btn btn-info btn-sm" states="uninstalled,uninstallable" t-if="record.to_buy.raw_value" role="button" groups="base.group_system">Upgrade</a>
|
||||
<button states="to remove" type="object" class="btn btn-sm btn-primary" name="button_uninstall_cancel" groups="base.group_system">Cancel Uninstall</button>
|
||||
<button states="to install" type="object" class="btn btn-sm btn-primary" name="button_install_cancel" groups="base.group_system">Cancel Install</button>
|
||||
|
||||
@@ -166,10 +166,10 @@
|
||||
<field name="priority" eval="1"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Partners">
|
||||
<div class="alert alert-warning oe_edit_only" role="alert" attrs="{'invisible': [('same_vat_partner_id', '=', False)]}">
|
||||
<div class="alert alert-warning oe_edit_only" role="alert" name="warning_tax" attrs="{'invisible': [('same_vat_partner_id', '=', False)]}">
|
||||
A partner with the same <span><span class="o_vat_label">Tax ID</span></span> already exists (<field name="same_vat_partner_id"/>), are you sure to create a new one?
|
||||
</div>
|
||||
<div class="alert alert-warning oe_edit_only" role="alert" attrs="{'invisible': [('same_company_registry_partner_id', '=', False)]}">
|
||||
<div class="alert alert-warning oe_edit_only" role="alert" name="warning_company" attrs="{'invisible': [('same_company_registry_partner_id', '=', False)]}">
|
||||
A partner with the same <span><span class="o_vat_label">Company Registry</span></span> already exists (<field name="same_company_registry_partner_id"/>), are you sure to create a new one?
|
||||
</div>
|
||||
<sheet>
|
||||
|
||||
Reference in New Issue
Block a user