[IMP] pre-commit: first run on whole repo

This commit is contained in:
Kevin Khao
2021-11-26 18:54:38 +03:00
parent a04b8980e1
commit 167aefee13
289 changed files with 6020 additions and 4170 deletions

View File

@@ -4,12 +4,12 @@
{
'name': 'Product Usability',
'version': '14.0.1.0.0',
'category': 'Product',
'license': 'AGPL-3',
'summary': 'Small usability enhancements to the product module',
'description': """
"name": "Product Usability",
"version": "14.0.1.0.0",
"category": "Product",
"license": "AGPL-3",
"summary": "Small usability enhancements to the product module",
"description": """
Product Usability
=================
@@ -23,15 +23,15 @@ The usability enhancements include:
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['product'],
'data': [
'views/product_supplierinfo_view.xml',
'views/product_pricelist_view.xml',
'views/product_pricelist_item.xml',
'views/product_template_view.xml',
'views/product_product.xml',
"author": "Akretion",
"website": "https://github.com/OCA/odoo-usability",
"depends": ["product"],
"data": [
"views/product_supplierinfo_view.xml",
"views/product_pricelist_view.xml",
"views/product_pricelist_item.xml",
"views/product_template_view.xml",
"views/product_product.xml",
],
'installable': True,
"installable": True,
}

View File

@@ -6,6 +6,6 @@ from odoo import fields, models
class ProductPricelist(models.Model):
_inherit = 'product.pricelist'
_inherit = "product.pricelist"
company_id = fields.Many2one(default=lambda self: self.env.company)

View File

@@ -3,26 +3,29 @@
# @author Raphaël Valyi <rvalyi@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
from odoo import fields, models
class ProductProduct(models.Model):
_inherit = 'product.product'
_inherit = "product.product"
default_code = fields.Char(copy=False)
# track_visibility='onchange',
# track_visibility='onchange',
# barcode = fields.Char(track_visibility='onchange',
# barcode = fields.Char(track_visibility='onchange',
# weight = fields.Float(track_visibility='onchange')
# active = fields.Boolean(track_visibility='onchange')
# weight = fields.Float(track_visibility='onchange')
# active = fields.Boolean(track_visibility='onchange')
_sql_constraints = [(
# Maybe it could be better to have a constrain per company
# but the company_id field is on product.template,
# not on product.product
# If it's a problem, we'll create a company_id field on
# product.product
'default_code_uniq',
'unique(default_code)',
'This internal reference already exists!')]
_sql_constraints = [
(
# Maybe it could be better to have a constrain per company
# but the company_id field is on product.template,
# not on product.product
# If it's a problem, we'll create a company_id field on
# product.product
"default_code_uniq",
"unique(default_code)",
"This internal reference already exists!",
)
]

View File

@@ -7,6 +7,6 @@ from odoo import fields, models
class ProductSupplierinfo(models.Model):
_inherit = 'product.supplierinfo'
_inherit = "product.supplierinfo"
name = fields.Many2one(domain=[('parent_id', '=', False)])
name = fields.Many2one(domain=[("parent_id", "=", False)])

View File

@@ -3,19 +3,19 @@
# @author Raphaël Valyi <rvalyi@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
_inherit = "product.template"
# restore v8 native field
# https://github.com/odoo/odoo/blob/8.0/addons/product/product.py#L592
# 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,
string='Main Supplier')
"res.partner", related="seller_ids.name", store=True, string="Main Supplier"
)
# in v14, I noticed that the tracking of the fields of product.template
# are only shown in the form view of product.template, not in the form

View File

@@ -1,28 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2015-2020 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).
-->
<odoo>
<record id="product_pricelist_item_view_search" model="ir.ui.view">
<field name="name">product.pricelist.item.search</field>
<field name="model">product.pricelist.item</field>
<field name="inherit_id" ref="product.product_pricelist_item_view_search"/>
<field name="inherit_id" ref="product.product_pricelist_item_view_search" />
<field name="arch" type="xml">
<field name="pricelist_id" position="after">
<field name="product_tmpl_id"/>
<field name="product_id"/>
<field name="categ_id"/>
<field name="product_tmpl_id" />
<field name="product_id" />
<field name="categ_id" />
</field>
<filter name="groupby_vendor" position="after">
<filter name="applied_on_groupby" string="Apply On" context="{'group_by': 'applied_on'}"/>
<filter name="base_on_groupby" string="Based On" context="{'group_by': 'base'}"/>
<filter name="compute_price_groupby" string="Compute Price" context="{'group_by': 'compute_price'}"/>
<filter name="currency_groupby" string="Currency" context="{'group_by': 'currency_id'}"/>
<filter
name="applied_on_groupby"
string="Apply On"
context="{'group_by': 'applied_on'}"
/>
<filter
name="base_on_groupby"
string="Based On"
context="{'group_by': 'base'}"
/>
<filter
name="compute_price_groupby"
string="Compute Price"
context="{'group_by': 'compute_price'}"
/>
<filter
name="currency_groupby"
string="Currency"
context="{'group_by': 'currency_id'}"
/>
</filter>
</field>
</record>
@@ -30,10 +45,12 @@
<record id="product_pricelist_item_form_view" model="ir.ui.view">
<field name="name">usability.product.pricelist.item.form</field>
<field name="model">product.pricelist.item</field>
<field name="inherit_id" ref="product.product_pricelist_item_form_view"/>
<field name="inherit_id" ref="product.product_pricelist_item_form_view" />
<field name="arch" type="xml">
<field name="pricelist_id" position="attributes">
<attribute name="invisible">not context.get('product_pricelist_item_main_view')</attribute>
<attribute
name="invisible"
>not context.get('product_pricelist_item_main_view')</attribute>
</field>
</field>
</record>

View File

@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2015-2020 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).
-->
<odoo>
@@ -19,15 +18,17 @@
<record id="product_pricelist_view" model="ir.ui.view">
<field name="name">usability.product.pricelist.form</field>
<field name="model">product.pricelist</field>
<field name="inherit_id" ref="product.product_pricelist_view"/>
<field name="inherit_id" ref="product.product_pricelist_view" />
<field name="arch" type="xml">
<div class="oe_title" position="before">
<div name="button_box" class="oe_button_box">
<button name="%(pricelist_item_fullscreen_action)d"
class="oe_stat_button"
icon="fa-building-o"
type="action"
help="List view of pricelist items">
<button
name="%(pricelist_item_fullscreen_action)d"
class="oe_stat_button"
icon="fa-building-o"
type="action"
help="List view of pricelist items"
>
<div class="o_form_field o_stat_info">
<span class="o_stat_text">Lines Fullscreen</span>
</div>

View File

@@ -1,19 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2015-2020 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).
-->
<odoo>
<record id="product_product_tree_view" model="ir.ui.view">
<field name="name">usability.product.product.tree</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="inherit_id" ref="product.product_product_tree_view" />
<field name="arch" type="xml">
<field name="lst_price" position="after">
<field name="currency_id" invisible="1"/>
<field name="currency_id" invisible="1" />
</field>
<field name="lst_price" position="attributes">
<attribute name="widget">monetary</attribute>

View File

@@ -1,25 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2015-2020 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).
-->
<odoo>
<record id="product_supplierinfo_search_view" model="ir.ui.view">
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_search_view"/>
<field name="inherit_id" ref="product.product_supplierinfo_search_view" />
<field name="arch" type="xml">
<field name="product_tmpl_id" position="after">
<field name="product_name" filter_domain="['|', ('product_code', 'ilike', self), ('product_name', 'ilike', self)]" />
<field
name="product_name"
filter_domain="['|', ('product_code', 'ilike', self), ('product_name', 'ilike', self)]"
/>
</field>
</field>
</record>
<record id="product_supplierinfo_tree_view" model="ir.ui.view">
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_tree_view"/>
<field name="inherit_id" ref="product.product_supplierinfo_tree_view" />
<field name="arch" type="xml">
<field name="product_code" position="attributes">
<attribute name="optional">show</attribute>

View File

@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2015-2020 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).
-->
<odoo>
<!-- It also updates product.product search view -->
@@ -14,7 +13,11 @@
<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.name', 'ilike', self)]"
/>
</field>
</field>
</record>