Add module product_priority_star

This commit is contained in:
Alexis de Lattre
2023-01-20 12:01:57 +01:00
parent dbad21c13a
commit 1d463a744d
5 changed files with 89 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import product

View File

@@ -0,0 +1,20 @@
# Copyright 2023 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
_order = "priority desc, name, id"
priority = fields.Selection([
('0', 'Normal'),
('1', 'Top List'),
], default='0', index=True)
class ProductProduct(models.Model):
_inherit = 'product.product'
_order = 'priority desc, default_code, name, id'