Skip to content

Add a new column to prices to avoid editing pricing from the product interface if the price has been generated through a pricelist interface#19

Closed
JustShah wants to merge 4 commits into
6-add-the-optional-to-automatically-associate-users-to-groups-upon-signupfrom
9-add-a-new-column-to-prices-to-avoid-editing-pricing-from-the-product-interface-if-the-price-has-been-generated-through-a-pricelist-interface
Closed

Add a new column to prices to avoid editing pricing from the product interface if the price has been generated through a pricelist interface#19
JustShah wants to merge 4 commits into
6-add-the-optional-to-automatically-associate-users-to-groups-upon-signupfrom
9-add-a-new-column-to-prices-to-avoid-editing-pricing-from-the-product-interface-if-the-price-has-been-generated-through-a-pricelist-interface

Conversation

@JustShah

@JustShah JustShah commented Apr 8, 2025

Copy link
Copy Markdown

Description

This pull request introduces several enhancements to the pricing management system within the Spree application, focusing on the integration of price lists. The changes aim to improve data integrity and user experience by preventing unintended modifications to prices associated with price lists.

Key Changes:

  1. New Attributes for Prices:

    • Added contain_taxes and is_pricelist_price attributes to the Spree price model. These attributes facilitate better management of pricing, particularly in relation to tax handling and price list associations.
  2. Price List Price Check:

    • Implemented a check_pricelist_price method in both the variant API and the admin prices controller. This method prevents users from updating or deleting prices that are associated with a price list, ensuring the integrity of pricing data.
  3. Localization and User Feedback:

    • Added a new localization key for error messages that inform users when a price cannot be edited or deleted due to its association with a price list.
    • Updated the admin interface to:
      • Prevent editing and deleting of prices that belong to a price list.
      • Display a message indicating the associated price lists for prices that are part of a price list.

Benefits:

  • Enhances user feedback and clarity in the admin interface.
  • Protects prices tied to price lists from unintended modifications.
  • Improves overall pricing management experience for administrators.

@JustShah JustShah force-pushed the 6-add-the-optional-to-automatically-associate-users-to-groups-upon-signup branch 2 times, most recently from c51f789 to bed02f2 Compare April 9, 2025 05:25
@JustShah JustShah force-pushed the 9-add-a-new-column-to-prices-to-avoid-editing-pricing-from-the-product-interface-if-the-price-has-been-generated-through-a-pricelist-interface branch 2 times, most recently from 21da636 to 655795f Compare April 9, 2025 05:27
@JustShah JustShah force-pushed the 6-add-the-optional-to-automatically-associate-users-to-groups-upon-signup branch from bed02f2 to 7e52bb1 Compare April 9, 2025 05:42
JustShah added 4 commits April 9, 2025 11:13
Implemented `check_pricelist_price` in variant API and price admin controllers to prevent the user from updating prices which are associated to a price list.
- Added a new localization key for the error message indicating that a price belongs to a price list and cannot be edited or deleted.
- Updated the master variant price table and the general price table in the admin interface to:
  - Prevent editing and deleting of prices that belong to a price list.
  - Display a message indicating the associated price lists for prices that are part of a price list.

These changes enhance user feedback and ensure that prices tied to price lists are clearly marked and protected from unintended modifications.
This change adds fields for contain_taxes and is_pricelist_price to price list item form.
@JustShah JustShah force-pushed the 9-add-a-new-column-to-prices-to-avoid-editing-pricing-from-the-product-interface-if-the-price-has-been-generated-through-a-pricelist-interface branch from 655795f to 2f7681c Compare April 9, 2025 05:43
@JustShah

JustShah commented Apr 9, 2025

Copy link
Copy Markdown
Author

created a new independent and improved PR: #22

@JustShah JustShah closed this Apr 9, 2025
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.

1 participant