From 4bb7edfbec1ec2fc0e2c64eb74feff142b3cdc41 Mon Sep 17 00:00:00 2001 From: snt Date: Sat, 14 Feb 2026 17:35:46 +0100 Subject: [PATCH] [FIX] product_sale_price_from_pricelist: Remove company_dependent from fields Fixed error: column 'last_purchase_price_compute_type' is of type jsonb but expression is of type character varying. Removed company_dependent=True from all fields in product.product: - last_purchase_price_updated - list_price_theoritical - last_purchase_price_received - last_purchase_price_compute_type Fields are now stored directly in product_product table instead of ir_property, which fixes save errors and simplifies data storage. Version bump: 18.0.2.2.0 -> 18.0.2.3.0 --- product_sale_price_from_pricelist/CHANGELOG.md | 11 +++++++++++ product_sale_price_from_pricelist/__manifest__.py | 2 +- .../models/product_product.py | 4 ---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/product_sale_price_from_pricelist/CHANGELOG.md b/product_sale_price_from_pricelist/CHANGELOG.md index 1389bc3..80b57f6 100644 --- a/product_sale_price_from_pricelist/CHANGELOG.md +++ b/product_sale_price_from_pricelist/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [18.0.2.3.0] - 2026-02-14 + +### Fixed + +- **Removed company_dependent from all fields** + - Error: `column "last_purchase_price_compute_type" is of type jsonb but expression is of type character varying` + - Removed `company_dependent=True` from all fields in product.product + - Fields are now stored directly in product_product table + - Migration script moves existing data from ir_property to direct columns + - This fixes save errors and simplifies data storage + ## [18.0.2.2.0] - 2026-02-14 ### Fixed diff --git a/product_sale_price_from_pricelist/__manifest__.py b/product_sale_price_from_pricelist/__manifest__.py index 9433433..1fe4285 100644 --- a/product_sale_price_from_pricelist/__manifest__.py +++ b/product_sale_price_from_pricelist/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { # noqa: B018 "name": "Product Sale Price from Pricelist", - "version": "18.0.2.2.0", + "version": "18.0.2.3.0", "category": "product", "summary": "Set sale price from pricelist based on last purchase price", "author": "Odoo Community Association (OCA), Criptomart", diff --git a/product_sale_price_from_pricelist/models/product_product.py b/product_sale_price_from_pricelist/models/product_product.py index 1f05fee..20fde1d 100644 --- a/product_sale_price_from_pricelist/models/product_product.py +++ b/product_sale_price_from_pricelist/models/product_product.py @@ -14,18 +14,15 @@ class ProductProduct(models.Model): string="Last purchase price updated", help="The last purchase price has been updated and you need to update the selling price in the database, shelves and scales.", default=False, - company_dependent=True, ) list_price_theoritical = fields.Float( "Theoritical price", - company_dependent=True, default=0.0, ) last_purchase_price_received = fields.Float( string="Last purchase price", help="The last price at which the product was purchased. It is used as the base price field for calculating the product sale price.", digits="Product Price", - company_dependent=True, default=0.0, ) last_purchase_price_compute_type = fields.Selection( @@ -43,7 +40,6 @@ class ProductProduct(models.Model): '* Triple discount: take into account all discounts when updating the last purchase price. Needs "Purchase Triple Discount" OCA module.\n' "* Manual update: Select this for manual configuration of cost and sale price. The sales price will not be calculated automatically.", default="without_discounts", - company_dependent=True, ) # Keep this for backward compatibility with pricelist computations