Browse Source

[FIX] contract: Be totally deterministic about which views to use

Having a primary view that is not explicitly declared to be uses and w/o priority
makes Odoo to choose between one of them randomly (well, not exactly, but kind of),
so we put here which views to use.

I have also put tree view as primary and put a large priority for not being
selected on other actions that don't have this explicit views.

A friendly name in views is also assigned.
pull/121/head
Pedro M. Baeza 7 years ago
parent
commit
98de4e0728
  1. 23
      contract/views/account_analytic_account_view.xml

23
contract/views/account_analytic_account_view.xml

@ -2,10 +2,11 @@
<odoo>
<record id="account_analytic_account_recurring_form_form" model="ir.ui.view">
<field name="name">account.analytic.account.invoice.recurring.form.inherit</field>
<field name="name">Contract form</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field name="mode">primary</field>
<field name="priority" eval="9999"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']/.." position="before">
<header>
@ -79,9 +80,11 @@
<!-- Inherited Analytic Account list for contracts -->
<record id="view_account_analytic_account_journal_tree" model="ir.ui.view">
<field name="name">account.analytic.account.journal.list</field>
<field name="name">Contract list</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_list" />
<field name="mode">primary</field>
<field name="priority" eval="9999"/>
<field name="arch" type="xml">
<field name="partner_id" position="before">
<field name="journal_id" groups="account.group_account_user"/>
@ -94,7 +97,7 @@
<!-- Analytic Account search view for contract -->
<record id="view_account_analytic_account_contract_search" model="ir.ui.view">
<field name="name">account.analytic.account.contract.search</field>
<field name="name">Contract search</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_search"/>
<field name="arch" type="xml">
@ -130,6 +133,20 @@
</field>
</record>
<record id="action_account_analytic_overdue_all_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_account_analytic_account_journal_tree"/>
<field name="act_window_id" ref="action_account_analytic_overdue_all"/>
</record>
<record id="action_account_analytic_overdue_all_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="account_analytic_account_recurring_form_form"/>
<field name="act_window_id" ref="action_account_analytic_overdue_all"/>
</record>
<menuitem id="menu_action_account_analytic_overdue_all"
parent="account.menu_finance_receivables"
action="action_account_analytic_overdue_all"

Loading…
Cancel
Save