[FIX] fix showing all variant active or inactive
This commit is contained in:
@@ -1 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import models
|
||||||
|
|||||||
3
product_variant_usability/models/__init__.py
Normal file
3
product_variant_usability/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import product
|
||||||
16
product_variant_usability/models/product.py
Normal file
16
product_variant_usability/models/product.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2017 Akretion (http://www.akretion.com).
|
||||||
|
# @author Sébastien BEAU <sebastien.beau@akretion.com>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from openerp import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class ProductTemplate(models.Model):
|
||||||
|
_inherit = 'product.template'
|
||||||
|
|
||||||
|
all_product_variant_ids = fields.One2many(
|
||||||
|
'product.product',
|
||||||
|
'product_tmpl_id',
|
||||||
|
'All Product Variant',
|
||||||
|
domain=['|', ('active', '=', False), ('active', '=', True)])
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<record id="product_template_view_form" model="ir.ui.view">
|
<record id="product_template_view_form" model="ir.ui.view">
|
||||||
<field name="model">product.template</field>
|
<field name="model">product.template</field>
|
||||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||||
<field name="priority" eval="64"/>
|
<field name="priority" eval="64"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="attribute_line_ids" position="after">
|
<field name="attribute_line_ids" position="after">
|
||||||
<field name="product_variant_ids" nolabel="1" domain="['|', ('active', '=', False), ('active', '=', True)]" required="0">
|
<field name="all_product_variant_ids" nolabel="1" required="0">
|
||||||
<tree create="0">
|
<tree create="0">
|
||||||
<field name="default_code"/>
|
<field name="default_code"/>
|
||||||
<field name="attribute_value_ids" widget="many2many_tags"/>
|
<field name="attribute_value_ids" widget="many2many_tags"/>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
icon="gtk-stop"/>
|
icon="gtk-stop"/>
|
||||||
<button type="object"
|
<button type="object"
|
||||||
name="button_deactivate"
|
name="button_deactivate"
|
||||||
attrs="{'invisible': [('active','=',False)]}"
|
attrs="{'invisible': [('active','=',False)]}"
|
||||||
icon="gtk-apply"/>
|
icon="gtk-apply"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user