Skip to content

Commit

Permalink
[FIX] *: wrong color_field attribute for m2m_tags
Browse files Browse the repository at this point in the history
This fix previous commit a29f7f6.

(1) Some objects have no color field.
(2) There was an issue when two many2many tags were instantiated:
    If the first one had the 'color_field' attribute the second one
    had it too even if this attribute weren't specified.
    Now, it's fixed in data_manager
  • Loading branch information
adr-odoo committed Jul 24, 2017
1 parent 666b594 commit a47d2d8
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 38 deletions.
4 changes: 2 additions & 2 deletions addons/account/views/account_invoice_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
<field name="uom_id" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="discount" groups="base.group_no_one"/>
<field name="invoice_line_tax_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" context="{'type':parent.type}"
<field name="invoice_line_tax_ids" widget="many2many_tags" options="{'no_create': True}" context="{'type':parent.type}"
domain="[('type_tax_use','=','purchase'),('company_id', '=', parent.company_id)]"/>
<field name="price_subtotal"/>
<field name="currency_id" invisible="1"/>
Expand Down Expand Up @@ -409,7 +409,7 @@
<field name="uom_id" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="discount" groups="base.group_no_one"/>
<field name="invoice_line_tax_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" context="{'type':parent.type}"
<field name="invoice_line_tax_ids" widget="many2many_tags" options="{'no_create': True}" context="{'type':parent.type}"
domain="[('type_tax_use','=','sale'),('company_id', '=', parent.company_id)]"/>
<field name="price_subtotal"/>
<field name="currency_id" invisible="1"/>
Expand Down
8 changes: 4 additions & 4 deletions addons/account/views/account_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@
<group>
<group string="Control-Access" groups="base.group_no_one">
<div class="text-muted" colspan="2">Keep empty for no control</div>
<field name="type_control_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="account_control_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="type_control_ids" widget="many2many_tags"/>
<field name="account_control_ids" widget="many2many_tags"/>
</group>
<group string="Miscellaneous">
<field name="inbound_payment_method_ids" widget="many2many_checkboxes" attrs="{'invisible': [('type', 'not in', ['bank', 'cash'])]}"/>
Expand Down Expand Up @@ -1892,8 +1892,8 @@
<field name="name"/>
<field name="attribute_value_ids" widget="many2many_tags" groups="product.group_product_variant"/>
<field name="lst_price"/>
<field name="taxes_id" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="supplier_taxes_id" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="taxes_id" widget="many2many_tags"/>
<field name="supplier_taxes_id" widget="many2many_tags"/>
</tree>
</field>
</record>
Expand Down
4 changes: 2 additions & 2 deletions addons/account/views/product_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
<field name="property_account_income_id"
domain="[('internal_type','=','other'),('deprecated','=',False)]"
groups="account.group_account_user"/>
<field name="taxes_id" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="taxes_id" widget="many2many_tags"/>
</group>
<group>
<field name="property_account_expense_id"
domain="[('internal_type','=','other'),('deprecated','=',False)]"
groups="account.group_account_user"/>
<field name="supplier_taxes_id" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="supplier_taxes_id" widget="many2many_tags"/>
</group>
</group>
<group name="accounting"/>
Expand Down
4 changes: 2 additions & 2 deletions addons/account_voucher/views/account_voucher_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<field name="account_analytic_id" domain="[('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
<field name="quantity"/>
<field name="price_unit"/>
<field name="tax_ids" widget="many2many_tags" options="{'color_field': 'color'}" domain="[('type_tax_use','=','sale')]"/>
<field name="tax_ids" widget="many2many_tags" domain="[('type_tax_use','=','sale')]"/>
<field name="price_subtotal"/>
<field name="currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
Expand Down Expand Up @@ -369,7 +369,7 @@
<field name="account_analytic_id" domain="[('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
<field name="quantity"/>
<field name="price_unit"/>
<field name="tax_ids" widget="many2many_tags" options="{'color_field': 'color'}" domain="[('type_tax_use','=','purchase')]"/>
<field name="tax_ids" widget="many2many_tags" domain="[('type_tax_use','=','purchase')]"/>
<field name="price_subtotal"/>
<field name="currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
Expand Down
4 changes: 2 additions & 2 deletions addons/delivery/views/delivery_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
</group>
<group>
<group>
<field name="country_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="state_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="country_ids" widget="many2many_tags"/>
<field name="state_ids" widget="many2many_tags"/>
</group>
<group></group>
<group>
Expand Down
4 changes: 2 additions & 2 deletions addons/hr_expense/views/hr_expense_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
</group>
<group string="Accounting">
<field name="property_account_expense_id"/>
<field name="supplier_taxes_id" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="supplier_taxes_id" widget="many2many_tags"/>
</group>
</group>
</sheet>
Expand Down Expand Up @@ -464,7 +464,7 @@
<field name="message_unread" invisible="1"/>
<field name="attachment_number" string=" "/>
<button name="action_get_attachment_view" string="View Attachments" type="object" icon="fa-paperclip"/>
<field name="tax_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="tax_ids" widget="many2many_tags"/>
<field name="total_amount" sum="Total Amount" widget="monetary"/>
</tree>
</field>
Expand Down
2 changes: 1 addition & 1 deletion addons/mass_mailing/views/mass_mailing_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
context="{'search_default_not_opt_out':1}"/>
<div attrs="{'invisible': [('mailing_model', '!=', 'mail.mass_mailing.list')]}">
<label for="contact_list_ids" string="Select mailing lists:" class="oe_edit_only"/>
<field name="contact_list_ids" widget="many2many_tags" options="{'color_field': 'color'}"
<field name="contact_list_ids" widget="many2many_tags"
placeholder="Select mailing lists..." class="oe_inline"/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion addons/membership/views/product_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<field name="list_price" string="Membership Fee"/>
<field
name="property_account_income_id"/>
<field name="taxes_id" widget="many2many_tags" options="{'color_field': 'color'}" string="Taxes"/>
<field name="taxes_id" widget="many2many_tags" string="Taxes"/>
</group>
</group>
<label for="description"/>
Expand Down
2 changes: 1 addition & 1 deletion addons/mrp/views/mrp_bom_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<button name="action_see_attachments" type="object" icon="fa-file" attrs="{'invisible': [('has_attachments', '=', True)]}"/>
<field name="product_qty"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="product.group_uom"/>
<field name="attribute_value_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('product_ids.product_tmpl_id', '=', parent.product_tmpl_id)]" groups="product.group_product_variant"/>
<field name="attribute_value_ids" widget="many2many_tags" options="{'no_create': True}" domain="[('product_ids.product_tmpl_id', '=', parent.product_tmpl_id)]" groups="product.group_product_variant"/>
<field name="operation_id" groups="mrp.group_mrp_routings" domain="[('routing_id', '=', parent.routing_id)]" options="{'no_quick_create':True,'no_create_edit':True}"/>
</tree>
</field>
Expand Down
8 changes: 4 additions & 4 deletions addons/mrp_repair/views/mrp_repair_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</div>
<field name="type" invisible="1"/>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" options="{'color_field': 'color'}" domain="[('type_tax_use','=','sale')]"/>
<field name="tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale')]"/>
<field name="invoiced" invisible="1"/>
<field name="price_subtotal" widget="monetary" invisible="1"/>
</group>
Expand Down Expand Up @@ -117,7 +117,7 @@
<field name="product_uom_qty" string="Quantity"/>
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="tax_id" widget="many2many_tags"/>
<field name="price_subtotal" widget="monetary"/>
</tree>
</field>
Expand Down Expand Up @@ -146,7 +146,7 @@
<field name="product_uom" groups="product.group_uom"/>
</div>
<field name="price_unit"/>
<field widget="many2many_tags" options="{'color_field': 'color'}" name="tax_id" domain="[('type_tax_use','=','sale')]"/>
<field widget="many2many_tags" name="tax_id" domain="[('type_tax_use','=','sale')]"/>
<field name="price_subtotal" widget="monetary" invisible="1"/>
</group>
</form>
Expand All @@ -156,7 +156,7 @@
<field name="product_uom_qty" string="Quantity"/>
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="tax_id" domain="[('type_tax_use', '=', 'sale')]" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="tax_id" domain="[('type_tax_use', '=', 'sale')]" widget="many2many_tags"/>
<field name="price_subtotal" widget="monetary"/>
</tree>
</field>
Expand Down
8 changes: 4 additions & 4 deletions addons/point_of_sale/views/pos_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<field name="qty"/>
<field name="price_unit" widget="monetary"/>
<field name="discount" widget="monetary"/>
<field name="tax_ids_after_fiscal_position" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="tax_ids" widget="many2many_tags" options="{'color_field': 'color'}" invisible="1"/>
<field name="tax_ids_after_fiscal_position" widget="many2many_tags"/>
<field name="tax_ids" widget="many2many_tags" invisible="1"/>
<field name="price_subtotal" widget="monetary"/>
<field name="price_subtotal_incl" widget="monetary"/>
</tree>
Expand All @@ -50,8 +50,8 @@
<field name="price_unit" widget="monetary"/>
<field name="price_subtotal" invisible="1" widget="monetary"/>
<field name="price_subtotal_incl" invisible="1" widget="monetary"/>
<field name="tax_ids_after_fiscal_position" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="tax_ids" widget="many2many_tags" options="{'color_field': 'color'}" invisible="1"/>
<field name="tax_ids_after_fiscal_position" widget="many2many_tags"/>
<field name="tax_ids" widget="many2many_tags" invisible="1"/>
<field name="notice"/>
</group>
</form>
Expand Down
6 changes: 3 additions & 3 deletions addons/purchase/views/purchase_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
<field name="qty_invoiced" invisible="not context.get('show_purchase', False)"/>
<field name="product_uom" groups="product.group_uom" attrs="{'readonly': [('state', 'in', ('purchase', 'done', 'cancel'))]}"/>
<field name="price_unit"/>
<field name="taxes_id" widget="many2many_tags" options="{'color_field': 'color'}" domain="[('type_tax_use','=','purchase')]" context="{'default_type_tax_use': 'purchase'}"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','=','purchase')]" context="{'default_type_tax_use': 'purchase'}"/>
<field name="price_subtotal" widget="monetary"/>
</tree>
<form string="Purchase Order Line">
Expand All @@ -242,7 +242,7 @@
<field name="price_unit"/>
</group>
<group>
<field name="taxes_id" widget="many2many_tags" options="{'color_field': 'color'}" domain="[('type_tax_use', '=', 'purchase')]"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use', '=', 'purchase')]"/>
<field name="date_planned" widget="date"/>
<field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
Expand Down Expand Up @@ -609,7 +609,7 @@
<field name="property_account_expense_id" domain="[('deprecated','=',False)]" attrs="{'readonly': [('purchase_ok', '=', 0)]}" groups="account.group_account_user"/>
</field>
<field name='supplier_taxes_id' position="replace" >
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags" options="{'color_field': 'color'}" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
</field>
</field>
</record>
Expand Down
4 changes: 2 additions & 2 deletions addons/sale/views/sale_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
</div>
</group>
<group>
<field name="tax_id" widget="many2many_tags" options="{'color_field': 'color'}" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
<field name="tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"/>
<label for="customer_lead"/>
<div>
Expand Down Expand Up @@ -281,7 +281,7 @@
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="price_unit"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"/>
<field name="tax_id" widget="many2many_tags" options="{'color_field': 'color'}" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
<field name="tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"/>
<field name="discount" groups="sale.group_discount_per_so_line"/>
<field name="price_subtotal" widget="monetary" groups="sale.group_show_price_subtotal"/>
Expand Down
2 changes: 1 addition & 1 deletion addons/stock/views/product_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<group name="inventory">
<group>
<field name="route_ids" widget="many2many_checkboxes" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}"/>
<field name="route_from_categ_ids" widget="many2many_tags" options="{'color_field': 'color'}" readonly="1" attrs="{'invisible':[('route_from_categ_ids', '=', [])]}"/>
<field name="route_from_categ_ids" widget="many2many_tags" readonly="1" attrs="{'invisible':[('route_from_categ_ids', '=', [])]}"/>
</group>
<group name="group_lots_and_weight">
<label for="weight" attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"/>
Expand Down
Loading

0 comments on commit a47d2d8

Please sign in to comment.