Ordena los productos por la fecha de creación, novedades.
This commit is contained in:
parent
1ea92cc281
commit
ada6c142c9
4 changed files with 35 additions and 0 deletions
1
website_sale_product_sort_creation_date/__init__.py
Normal file
1
website_sale_product_sort_creation_date/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from . import models
|
19
website_sale_product_sort_creation_date/__manifest__.py
Normal file
19
website_sale_product_sort_creation_date/__manifest__.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Copyright 2021 Criptomart
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
'name': 'Website Sale Product Sort Creation Date',
|
||||
'summary': 'Permite ordenar por la fecha de creación de los productos.',
|
||||
'version': '12.0.1.0.1',
|
||||
'development_status': 'Beta',
|
||||
'category': 'Website',
|
||||
'website': 'https://github.com/criptomart/obook',
|
||||
'author': 'Cripotmart',
|
||||
'license': 'AGPL-3',
|
||||
'depends': [
|
||||
'website_sale_product_sort',
|
||||
],
|
||||
'data': [
|
||||
],
|
||||
'application': False,
|
||||
'installable': True,
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
from . import website
|
||||
|
13
website_sale_product_sort_creation_date/models/website.py
Normal file
13
website_sale_product_sort_creation_date/models/website.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Copyright 2020 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
|
||||
class Website(models.Model):
|
||||
_inherit = "website"
|
||||
|
||||
@api.model
|
||||
def _get_product_sort_criterias(self):
|
||||
res = super()._get_product_sort_criterias()
|
||||
return res.append(("create_date desc", _("Novedades")))
|
||||
|
Loading…
Add table
Reference in a new issue