Repository navigation
Conversation
The module had no tests. These cover the two behaviours it adds to the product form, on product.template and on product.product: group_only_view turns the planned price fields readonly, and group_only_view_sale_price (which implies the former) also hides the planned price block. A plain user keeps the fields editable and the block visible.
Configuration and Usage were copied from price_security and listed its sale order, invoice and partner restrictions. This module only restricts the planned price fields on the product form, so the README now says that.
Contributor
This branch has not been deployed
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.

Migration of
price_security_planned_priceto 20.0.Tarea: https://www.adhoc.inc/odoo/project.task/76462
What changed
The Python of the module did not need any change:
_get_viewkeeps the samesignature and the same contract in 20.0, and none of the symbols the module
uses changed in the jump. The
[MIG]commit is just the manifest bump.On top of that:
product form, on
product.templateand onproduct.product:group_only_viewturns the planned price fields readonly, andgroup_only_view_sale_price(which implies it) also hides the planned priceblock.
price_securityanddescribed its sale order, invoice and partner restrictions. They now describe
what this module actually does.
.potre-exported: from 20.0 the export includes the module description,which is the README.
Depends on
This cannot be merged before:
product_planned_price, a direct dependencyproduct_replenishment_cost, a dependency of the aboveBoth were stacked locally to install and test. This branch is clean off
20.0.Test plan
pre-commit rungreen on every file of the module.--test-enable --test-tags /price_security_planned_price: 4 tests, 0 failed,0 errors. They were also seen failing on purpose, by dropping the
readonlyassignment from
product_template.py.Notes for the reviewer
Three things that already existed in 19.0 and this PR leaves as they are:
//group[@name='costing']matches nothing on the product form. That grouponly exists on
mrp.workcenterviews, both in 19.0 and in 20.0, and no OBAmodule adds it to the product form, so
group_only_view_sale_priceonly everhides the planned price block.
modifiersattribute is dead code: nothing in thecore reads or writes that attribute on view nodes, in 19.0 or in 20.0.
product_template.pyandproduct_product.pyare identical except for theclass name and the
_inherit.What makes this module correct is not obvious and is worth keeping in mind:
_get_viewruns inside_get_view_cache, whose ormcache key does not includethe user.
price_securityextends_get_view_cache_keyon both models with thetwo group flags, so each profile gets its own cached arch. If that key ever
changes, this module starts serving one user's arch to another.
Translations were not re-exported:
odoo-i18nfails on the language installstep with
psycopg2.errors.SerializationFailure, on a freshly created databasetoo. The
.pohas two terms and both are already translated.