[FW][MERGE] various: clean view definitions and coherency
PURPOSE Clean view definitions and coherency SPECIFICATIONS Remove dead code and files. Remove duplicate fields in tree views Remove duplicate field in kanban views, especially when dealing with preface / templates sections. Enforce currency presence for monetary widgets and fields. Use existing state values for state-based conditions in views More details in sub commits. Heuristics used to detect those issues will land in master as this merge targets a stable version. LINKS Task ID-2329114 PR odoo/odoo#56946 PR odoo/enterprise#12893 closes odoo/odoo#56996 Forward-port-of: odoo/odoo#56946 Related: odoo/enterprise#12917 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This commit is contained in:
@@ -48,11 +48,9 @@ You could use this simplified accounting in case you work with an (external) acc
|
||||
'views/account_report.xml',
|
||||
'data/mail_template_data.xml',
|
||||
'wizard/account_validate_move_view.xml',
|
||||
'views/account_end_fy.xml',
|
||||
'views/res_company_views.xml',
|
||||
'views/product_view.xml',
|
||||
'views/account_analytic_view.xml',
|
||||
'views/account_tip_data.xml',
|
||||
'views/account.xml',
|
||||
'views/report_invoice.xml',
|
||||
'report/account_invoice_report_view.xml',
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -286,7 +286,8 @@
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="matching_number" position="after">
|
||||
<field name="move_id" position="replace"/>
|
||||
<field name="matching_number" position="replace">
|
||||
<field name="tax_line_id" string="Tax"/>
|
||||
<field name="tax_base_amount" sum="Total Base Amount"/>
|
||||
<field name="tax_audit"/>
|
||||
@@ -294,7 +295,6 @@
|
||||
</field>
|
||||
<field name="date_maturity" position="replace"/>
|
||||
<field name="analytic_account_id" position="replace"/>
|
||||
<field name="matching_number" position="replace"/>
|
||||
<field name="debit" position="replace"/>
|
||||
<field name="credit" position="replace"/>
|
||||
</field>
|
||||
@@ -778,7 +778,6 @@
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="display_type"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_card oe_kanban_global_click {{ record.display_type.raw_value ? 'o_is_' + record.display_type.raw_value : '' }}">
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -105,6 +105,7 @@
|
||||
context="{'default_partner_id': active_id}">
|
||||
<div class="o_form_field o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="total_invoiced" widget='monetary' options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
<span class="o_stat_text">Invoiced</span>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<header>
|
||||
<button name="contract_open" states="futur" type="object" string="Start Contract" class="oe_highlight" groups="fleet.fleet_group_manager"/>
|
||||
<button name="contract_close" states="futur" type="object" string="Cancel" groups="fleet.fleet_group_manager"/>
|
||||
<button name="contract_close" states="open,expired,future" type="object" class="oe_highlight" string="Close Contract" groups="fleet.fleet_group_manager"/>
|
||||
<button name="contract_close" states="open,expired,futur" type="object" class="oe_highlight" string="Close Contract" groups="fleet.fleet_group_manager"/>
|
||||
<button name="contract_draft" states="closed" type="object" string="Reset To Draft" groups="fleet.fleet_group_manager"/>
|
||||
<field name="state" widget="statusbar" />
|
||||
</header>
|
||||
|
||||
@@ -460,7 +460,6 @@
|
||||
<field name="payslip_status" widget="toggle_button" options='{"active": "Reported in last payslips", "inactive": "To Report in Payslip"}' groups="hr_holidays.group_hr_holidays_user" nolabel="1"/>
|
||||
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state in ('confirm','validate1')" decoration-success="state == 'validate'"/>
|
||||
<field name="category_id" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="message_needaction" invisible="1"/>
|
||||
<button string="Approve" name="action_approve" type="object"
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
<field name="description"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="price" widget="monetary"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -142,7 +142,6 @@
|
||||
<field name="type"/>
|
||||
<field name="create_uid"/>
|
||||
<field name="url"/>
|
||||
<field name="type"/>
|
||||
<field name="create_date"/>
|
||||
<field name="name"/>
|
||||
<templates>
|
||||
|
||||
@@ -422,7 +422,6 @@
|
||||
<field name="maintenance_ids"/>
|
||||
<field name="maintenance_open_count"/>
|
||||
<field name="next_action_date"/>
|
||||
<field name="technician_user_id"/>
|
||||
<field name="activity_ids" />
|
||||
<field name="activity_state" />
|
||||
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
<field name="priority">10</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Mailings" sample="1">
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
|
||||
<field name="mailing_type" invisible="1"/>
|
||||
<field name="mailing_model_id" string="Recipients"/>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<button name="button_unplan" type="object" string="Unplan" attrs="{'invisible': ['|', '|', ('is_planned', '!=', 'True'), ('date_planned_start', '=', False), ('date_planned_finished', '=', False)]}"/>
|
||||
<button name="button_unreserve" type="object" string="Unreserve" attrs="{'invisible': [('unreserve_visible', '=', False)]}"/>
|
||||
<button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,progress,done"/>
|
||||
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}" string="Unlock" groups="mrp.group_mrp_manager" type="object" help="Unlock the manufacturing order to adjust what has been consumed or produced."/>
|
||||
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}" string="Lock" groups="mrp.group_mrp_manager" type="object" help="Lock the manufacturing order to prevent changes to what has been consumed or produced."/>/>
|
||||
<button name="action_cancel" type="object" string="Cancel"
|
||||
|
||||
@@ -279,6 +279,7 @@
|
||||
<div class="col-6">
|
||||
<span class="float-right">
|
||||
<field name="amount" widget="monetary"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
<field name="tax_ids" widget="many2many_tags" invisible="1"/>
|
||||
<field name="price_subtotal" widget="monetary" force_save="1"/>
|
||||
<field name="price_subtotal_incl" widget="monetary" force_save="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
<form string="Order lines">
|
||||
<group col="4">
|
||||
@@ -68,6 +69,7 @@
|
||||
<field name="tax_ids" widget="many2many_tags" invisible="1"/>
|
||||
<field name="pack_lot_ids" widget="many2many_tags" groups="stock.group_production_lot"/>
|
||||
<field name="notice"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -90,6 +92,7 @@
|
||||
class="oe_subtotal_footer_separator"
|
||||
widget="monetary"
|
||||
attrs="{'invisible': [('amount_paid','=', 'amount_total')]}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
<div class="oe_clear"/>
|
||||
</page>
|
||||
@@ -274,6 +277,7 @@
|
||||
<field name="price_subtotal" readonly="1" sum="Sum of subtotals" widget="monetary"/>
|
||||
<field name="price_subtotal_incl" readonly="1" sum="Sum of subtotals" widget="monetary"/>
|
||||
<field name="create_date" readonly="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -289,6 +293,7 @@
|
||||
<field name="discount" widget="monetary"/>
|
||||
<field name="price_unit" widget="monetary"/>
|
||||
<field name="create_date" />
|
||||
<field name="currency_id"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -329,6 +334,7 @@
|
||||
<field name="product_id" />
|
||||
<field name="qty" />
|
||||
<field name="price_unit" widget="monetary"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -674,6 +674,7 @@
|
||||
<field name="product_qty"/>
|
||||
<field name="product_uom" groups="uom.group_uom"/>
|
||||
<field name="price_subtotal" widget="monetary"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="date_planned" widget="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -79,6 +79,7 @@ class Repair(models.Model):
|
||||
'product.pricelist', 'Pricelist',
|
||||
default=lambda self: self.env['product.pricelist'].search([('company_id', 'in', [self.env.company.id, False])], limit=1).id,
|
||||
help='Pricelist of the selected partner.', check_company=True)
|
||||
currency_id = fields.Many2one(related='pricelist_id.currency_id')
|
||||
partner_invoice_id = fields.Many2one('res.partner', 'Invoicing Address', check_company=True)
|
||||
invoice_method = fields.Selection([
|
||||
("none", "No Invoice"),
|
||||
@@ -602,6 +603,8 @@ class RepairLine(models.Model):
|
||||
index=True, ondelete='cascade', check_company=True)
|
||||
company_id = fields.Many2one(
|
||||
related='repair_id.company_id', store=True, index=True)
|
||||
currency_id = fields.Many2one(
|
||||
related='repair_id.currency_id')
|
||||
type = fields.Selection([
|
||||
('add', 'Add'),
|
||||
('remove', 'Remove')], 'Type', required=True)
|
||||
@@ -737,6 +740,8 @@ class RepairFee(models.Model):
|
||||
index=True, ondelete='cascade', required=True)
|
||||
company_id = fields.Many2one(
|
||||
related="repair_id.company_id", index=True, store=True)
|
||||
currency_id = fields.Many2one(
|
||||
related="repair_id.currency_id")
|
||||
name = fields.Text('Description', index=True, required=True)
|
||||
product_id = fields.Many2one(
|
||||
'product.product', 'Product', check_company=True,
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
<field name="partner_invoice_id" attrs="{'invisible':[('invoice_method','=', 'none')],'required':[('invoice_method','!=','none')]}" groups="sale.group_delivery_invoice_address"/>
|
||||
<field name="pricelist_id" groups="product.group_product_pricelist" context="{'product_id':product_id}" attrs="{'invisible':[('invoice_method','=', 'none')]}"/>
|
||||
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
@@ -106,6 +107,7 @@
|
||||
<field name="tax_id" widget="many2many_tags"/>
|
||||
<field name="invoiced" invisible="1"/>
|
||||
<field name="price_subtotal" widget="monetary" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="lot_id" context="{'default_product_id': product_id, 'default_company_id': company_id}" groups="stock.group_production_lot"/>
|
||||
@@ -132,6 +134,7 @@
|
||||
<field name="price_unit"/>
|
||||
<field name="tax_id" widget="many2many_tags" optional="show"/>
|
||||
<field name="price_subtotal" widget="monetary"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group class="oe_subtotal_footer oe_right">
|
||||
@@ -162,6 +165,7 @@
|
||||
<field name="price_unit"/>
|
||||
<field widget="many2many_tags" name="tax_id"/>
|
||||
<field name="price_subtotal" widget="monetary" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
</form>
|
||||
<tree string="Fees" editable="bottom">
|
||||
@@ -174,6 +178,7 @@
|
||||
<field name="price_unit"/>
|
||||
<field name="tax_id" widget="many2many_tags" optional="show"/>
|
||||
<field name="price_subtotal" widget="monetary"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
@@ -1015,6 +1015,7 @@
|
||||
<field name="qty_to_invoice"/>
|
||||
<field name="product_uom" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
<field name="price_subtotal" sum="Total" widget="monetary"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<header>
|
||||
<button name="snailmail_print" string="Send Now" type="object" states="pending,error" class="oe_highlight"/>
|
||||
<button name="cancel" string="Cancel" type="object" states="pending,error"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="pending,sent,cancel"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="pending,sent,canceled"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
|
||||
@@ -201,7 +201,6 @@
|
||||
<field name="company_id" invisible="1" force_save="1"/>
|
||||
<field name="picking_id" invisible="1" force_save="1"/>
|
||||
<field name="move_id" invisible="1" force_save="1" />
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="package_level_id" invisible="1"/>
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="allowed_route_ids" invisible="1"/>
|
||||
<field name="product_category_id" invisible="1"/>
|
||||
<field name="warehouse_id" invisible="1"/>
|
||||
<field name="product_tmpl_id" invisible="1"/>
|
||||
<field name="product_id" attrs="{'readonly': [('product_id', '!=', False)]}" invisible="context.get('default_product_id')" force_save="1"/>
|
||||
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
<button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': ['|', '&', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}"/>
|
||||
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('state', 'in', ('draft','cancel')), ('is_locked', '=', False)]}" string="Unlock" groups="stock.group_stock_manager" type="object" help="If the picking is unlocked you can edit initial demand (for a draft picking) or done quantities (for a done picking)."/>
|
||||
<button name="action_toggle_is_locked" attrs="{'invisible': [('is_locked', '=', True)]}" string="Lock" groups="stock.group_stock_manager" type="object"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,partially_available,assigned,done" />
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done" />
|
||||
<button name="action_cancel" attrs="{'invisible': [('state', 'not in', ('assigned', 'confirmed', 'partially_available', 'draft', 'waiting'))]}" string="Cancel" groups="base.group_user" type="object"/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header" position="replace">
|
||||
<header>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,partially_available,assigned,done"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done"/>
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user