Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions product_ux/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
##############################################################################
{
"name": "Product UX",
<<<<<<< 407ba0622b343473aa9778a60f57e42f8b649bb1
"version": "19.0.1.0.0",
||||||| 7420b7f23c25e6f46fe9a9c4d8da5a10e4aa0e73
"version": "18.0.1.1.0",
=======
"version": "18.0.1.2.0",
>>>>>>> d1d2831f6612dc479501e33fc6c6fe2f4ea6a491
"category": "Products",
"sequence": 14,
"summary": "",
Expand Down
13 changes: 13 additions & 0 deletions product_ux/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,26 @@
# directory
##############################################################################
from odoo import api, fields, models
from odoo.tools import create_index


class ProductProduct(models.Model):
_inherit = "product.product"
_order = "default_code, name, id"

def init(self):
super().init()
create_index(
self.env.cr,
indexname="is_favorite_idx",
tablename="product_product",
expressions=["is_favorite"],
where="is_favorite IS TRUE",
)

active = fields.Boolean(tracking=True)
pricelist_price = fields.Float(compute="_compute_product_pricelist_price", digits="Product Price")
is_favorite = fields.Boolean(related="product_tmpl_id.is_favorite", readonly=True, store=True)

@api.depends_context("pricelist", "quantity", "uom", "date", "no_variant_attributes_price_extra")
def _compute_product_pricelist_price(self):
Expand Down
Loading