Skip to content

[ADD] pos_product_fixed_price#1494

Open
mihien wants to merge 1 commit intoOCA:16.0from
coopiteasy:16.0-add-pos_product_unmodifiable_price
Open

[ADD] pos_product_fixed_price#1494
mihien wants to merge 1 commit intoOCA:16.0from
coopiteasy:16.0-add-pos_product_unmodifiable_price

Conversation

@mihien
Copy link
Copy Markdown

@mihien mihien commented Mar 9, 2026

Products can be set as having a fixed price in the PoS, meaning users can't change its price from the PoS interface.

@mihien mihien force-pushed the 16.0-add-pos_product_unmodifiable_price branch 2 times, most recently from 022e077 to bead5a7 Compare March 9, 2026 13:33
@mihien mihien force-pushed the 16.0-add-pos_product_unmodifiable_price branch from bead5a7 to 6136529 Compare March 16, 2026 01:30
Copy link
Copy Markdown
Member

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useful module, thanks @mihien. the code can be simplified, as explained below.

set_unit_price(price) {
// Price is not assigned on line creation and empty on line deletion
if (this.price && price !== "") {
if (this.product.is_pos_price_fix && this.price !== price) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in which case is this true? it doesn’t seem possible to happen, as the price can only be modified when the numpad is in price mode, which cannot happen on this product. is this whole method actually useful?

class extends OriginalOrderline {
set_unit_price(price) {
// Price is not assigned on line creation and empty on line deletion
if (this.price && price !== "") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

price is equal to "" only when the numpad is in price mode and the backspace key is used. in quantity mode it is never set to this value.

Suggested change
if (this.price && price !== "") {
if (this.price) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants