Syncing from upstream Vauxoo/addons-vauxoo (19.0)#369
Merged
Conversation
The approach is to have the USD as the base currency, so that the sale prices in company currency can be kept up to date through the exchange rate. Module features: - New Cost USD field on the Product form. - Validate Cost USD so that it is not less than the list price of the supplier. - Avoid save a 'Cost in USD' when product does not has assigned a supplier with price in USD. - Allowed pricelist computation based on Cost in USD. - Added unit tests to validate constrains and pricelists computation. - Compatibility with module sale_margin.
The Default Pricelist might be modified in other modules by this reason is not convinient use it in unit tests.
- Rename model files and remove parameters in super - Rename views files and views IDs - Change category and fix version in manifest - Remove headers on files
- Fixing translations - Fixing code comments on models - Adding demo data for product_pricelist
- add pre-migration in order to remove fix errors on inherited views of_product_template_tann_inhrt view
Modification to avoid errors coming from the store when listing the products, due to the fact that the the ID of the record used may belong to the product.template model, therefore change the iteration object to the variable `products_qty_partner` to more directly take the value of the product used in the process
Fix lint: - (implicit-str-concat)
When the currency of the company is different to USD, the field is shown with the currency of the company instead of USD, the field is set to be shown as USD.
The `sale_stock_margin` module recomputes the purchase price in sale order lines and calls `super()` only over the lines without a stock move related to it. This causes this module to not recompute the lines with stock moves related, leading to incorrect computation of the purchase price. This commit adds the `sale_stock_margin` module as a dependency in order to first run this module compute.
Since each company has its own purchase price, we must explicitly set the company we are working with (the one in the sale order line) to correctly set the purchase price.
Following the same approach as Odoo [1], the `auto_install` key is removed because its value is the same as the default. [1]: odoo/odoo#90209
Changes include: - Rename `product_uom` to `product_uom_id` in `sale.order.line` dependencies and computations according to [1]. - Update `_compute_price_rule` method call and dictionary extraction to match the new API signature according to [2]. - Optimize `product.pricelist.item` search by using direct `browse` instead of filtering `item_ids`. - Create test records (Partner, Product, Pricelist) dynamically as demo data is no longer loaded by default. - Set `price_discount` to `-15` in the test pricelist to comply with Odoo's native markup calculation standard. - Replace usage of the deprecated `price` field on product templates with `get_contextual_price()` according to [3]. - Replace usage of the deprecated `pricing` div on product template views with `list_price_uom` according to [4]. - Deprecate the usage of `invisible` in views according to [5]. - Removed deprecated inheritance in `product.pricelist` as it was causing silent fallbacks to `list_price`, breaking margin computations in sales orders. - Injected the raw USD cost directly via the official `_compute_base_price` hook in `product.pricelist.item`. - Added native support for UoM (Unit of Measure) conversions. - Grant `product.group_product_pricelist` explicitly in tests because demo data is no longer loaded by default, removing the implicit activation that previously made pricelist_id visible in the Form. [1]: odoo/odoo@c8461a5 [2]: odoo/odoo@57ced81 [3]: odoo/odoo@9e99a9d [4]: odoo/odoo@65652c7 [5]: odoo/odoo#137031
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bt_gitbot