[MIG] product_usability to v16
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
# Copyright 2015-2020 Akretion France (http://www.akretion.com)
|
# Copyright 2015-2022 Akretion France (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Product Usability',
|
'name': 'Product Usability',
|
||||||
'version': '14.0.1.0.0',
|
'version': '16.0.1.0.0',
|
||||||
'category': 'Product',
|
'category': 'Product',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'summary': 'Small usability enhancements to the product module',
|
'summary': 'Small usability enhancements to the product module',
|
||||||
@@ -15,18 +15,16 @@ Product Usability
|
|||||||
|
|
||||||
The usability enhancements include:
|
The usability enhancements include:
|
||||||
|
|
||||||
* show the object product.price.history in the product template form view
|
|
||||||
|
|
||||||
* wider name field in product form view
|
|
||||||
|
|
||||||
* hide description field on product (description_sale must be use instead of description)
|
* hide description field on product (description_sale must be use instead of description)
|
||||||
|
|
||||||
* add a field barcode_type in product form view
|
* add a field barcode_type in product form view
|
||||||
|
|
||||||
|
* allow to search a product by supplier
|
||||||
|
|
||||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||||
""",
|
""",
|
||||||
'author': 'Akretion',
|
'author': 'Akretion',
|
||||||
'website': 'http://www.akretion.com',
|
'website': 'https://github.com/akretion/odoo-usability',
|
||||||
'depends': ['product'],
|
'depends': ['product'],
|
||||||
"external_dependencies": {"python": ["stdnum"]},
|
"external_dependencies": {"python": ["stdnum"]},
|
||||||
'data': [
|
'data': [
|
||||||
@@ -38,5 +36,5 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
|
|||||||
'views/product_config_menu.xml',
|
'views/product_config_menu.xml',
|
||||||
'views/product_category_view.xml',
|
'views/product_category_view.xml',
|
||||||
],
|
],
|
||||||
'installable': False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2017-2020 Akretion (http://www.akretion.com/)
|
# Copyright 2017-2022 Akretion (http://www.akretion.com/)
|
||||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2015-2021 Akretion (http://www.akretion.com)
|
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# @author Raphaël Valyi <rvalyi@akretion.com>
|
# @author Raphaël Valyi <rvalyi@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
@@ -14,7 +14,7 @@ class ProductProduct(models.Model):
|
|||||||
barcode = fields.Char(tracking=20)
|
barcode = fields.Char(tracking=20)
|
||||||
weight = fields.Float(tracking=30)
|
weight = fields.Float(tracking=30)
|
||||||
active = fields.Boolean(tracking=40)
|
active = fields.Boolean(tracking=40)
|
||||||
barcode_type = fields.Char(compute='_compute_barcode_type')
|
barcode_type = fields.Char(compute='_compute_barcode_type', precompute=True)
|
||||||
|
|
||||||
_sql_constraints = [(
|
_sql_constraints = [(
|
||||||
# Maybe it could be better to have a constrain per company
|
# Maybe it could be better to have a constrain per company
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# @author Raphaël Valyi <rvalyi@akretion.com>
|
# @author Raphaël Valyi <rvalyi@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
@@ -9,4 +9,4 @@ from odoo import fields, models
|
|||||||
class ProductSupplierinfo(models.Model):
|
class ProductSupplierinfo(models.Model):
|
||||||
_inherit = 'product.supplierinfo'
|
_inherit = 'product.supplierinfo'
|
||||||
|
|
||||||
name = fields.Many2one(domain=[('parent_id', '=', False)])
|
partner_id = fields.Many2one(domain=[('parent_id', '=', False)])
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2015-2021 Akretion (http://www.akretion.com)
|
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# @author Raphaël Valyi <rvalyi@akretion.com>
|
# @author Raphaël Valyi <rvalyi@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
@@ -14,7 +14,7 @@ class ProductTemplate(models.Model):
|
|||||||
# in v10, that field was defined in procurement_suggest, but we will
|
# in v10, that field was defined in procurement_suggest, but we will
|
||||||
# probably not port procurement_suggest because it is native in v14
|
# probably not port procurement_suggest because it is native in v14
|
||||||
seller_id = fields.Many2one(
|
seller_id = fields.Many2one(
|
||||||
'res.partner', related='seller_ids.name', store=True,
|
'res.partner', related='seller_ids.partner_id', store=True,
|
||||||
string='Main Supplier')
|
string='Main Supplier')
|
||||||
|
|
||||||
# in v14, I noticed that the tracking of the fields of product.template
|
# in v14, I noticed that the tracking of the fields of product.template
|
||||||
@@ -24,7 +24,7 @@ class ProductTemplate(models.Model):
|
|||||||
barcode = fields.Char(tracking=20)
|
barcode = fields.Char(tracking=20)
|
||||||
default_code = fields.Char(tracking=30)
|
default_code = fields.Char(tracking=30)
|
||||||
categ_id = fields.Many2one(tracking=40)
|
categ_id = fields.Many2one(tracking=40)
|
||||||
type = fields.Selection(tracking=50)
|
detailed_type = fields.Selection(tracking=50)
|
||||||
list_price = fields.Float(tracking=60)
|
list_price = fields.Float(tracking=60)
|
||||||
weight = fields.Float(tracking=70)
|
weight = fields.Float(tracking=70)
|
||||||
sale_ok = fields.Boolean(tracking=80)
|
sale_ok = fields.Boolean(tracking=80)
|
||||||
@@ -33,6 +33,9 @@ class ProductTemplate(models.Model):
|
|||||||
company_id = fields.Many2one(tracking=110)
|
company_id = fields.Many2one(tracking=110)
|
||||||
barcode_type = fields.Char(compute='_compute_template_barcode_type')
|
barcode_type = fields.Char(compute='_compute_template_barcode_type')
|
||||||
|
|
||||||
|
# precompute=True doesn't work on product.template
|
||||||
|
# (works fine on product.product), probably because we don't depend
|
||||||
|
# on 'barcode'
|
||||||
@api.depends('product_variant_ids.barcode')
|
@api.depends('product_variant_ids.barcode')
|
||||||
def _compute_template_barcode_type(self):
|
def _compute_template_barcode_type(self):
|
||||||
ppo = self.env['product.product']
|
ppo = self.env['product.product']
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright 2015-2020 Akretion (http://www.akretion.com/)
|
Copyright 2015-2022 Akretion (http://www.akretion.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright 2015-2020 Akretion (http://www.akretion.com/)
|
Copyright 2015-2022 Akretion (http://www.akretion.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<field name="inherit_id" ref="product.product_template_search_view" />
|
<field name="inherit_id" ref="product.product_template_search_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="categ_id" position="after">
|
<field name="categ_id" position="after">
|
||||||
<field name="seller_ids" string="Supplier" filter_domain="[('seller_ids.name', 'ilike', self)]"/>
|
<field name="seller_ids" string="Supplier" filter_domain="[('seller_ids.partner_id', 'ilike', self)]"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user