[MIG] product_usability to v16

This commit is contained in:
Alexis de Lattre
2022-10-27 21:27:46 +02:00
parent 15c77b3e8a
commit a9292506ae
8 changed files with 20 additions and 19 deletions

View File

@@ -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>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Product Usability',
'version': '14.0.1.0.0',
'version': '16.0.1.0.0',
'category': 'Product',
'license': 'AGPL-3',
'summary': 'Small usability enhancements to the product module',
@@ -15,18 +15,16 @@ Product Usability
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)
* 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>.
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'website': 'https://github.com/akretion/odoo-usability',
'depends': ['product'],
"external_dependencies": {"python": ["stdnum"]},
'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_category_view.xml',
],
'installable': False,
'installable': True,
}

View File

@@ -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>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -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 Raphaël Valyi <rvalyi@akretion.com>
# 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)
weight = fields.Float(tracking=30)
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 = [(
# Maybe it could be better to have a constrain per company

View File

@@ -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 Raphaël Valyi <rvalyi@akretion.com>
# 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):
_inherit = 'product.supplierinfo'
name = fields.Many2one(domain=[('parent_id', '=', False)])
partner_id = fields.Many2one(domain=[('parent_id', '=', False)])

View File

@@ -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 Raphaël Valyi <rvalyi@akretion.com>
# 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
# probably not port procurement_suggest because it is native in v14
seller_id = fields.Many2one(
'res.partner', related='seller_ids.name', store=True,
'res.partner', related='seller_ids.partner_id', store=True,
string='Main Supplier')
# 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)
default_code = fields.Char(tracking=30)
categ_id = fields.Many2one(tracking=40)
type = fields.Selection(tracking=50)
detailed_type = fields.Selection(tracking=50)
list_price = fields.Float(tracking=60)
weight = fields.Float(tracking=70)
sale_ok = fields.Boolean(tracking=80)
@@ -33,6 +33,9 @@ class ProductTemplate(models.Model):
company_id = fields.Many2one(tracking=110)
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')
def _compute_template_barcode_type(self):
ppo = self.env['product.product']

View File

@@ -1,6 +1,6 @@
<?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>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

View File

@@ -1,6 +1,6 @@
<?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>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

View File

@@ -14,7 +14,7 @@
<field name="inherit_id" ref="product.product_template_search_view" />
<field name="arch" type="xml">
<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>
</record>