| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Sales (sale_management)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 520 |
| Technical Name |
xpt_price_campaign |
| License | OPL-1 |
| Website | https://xpedyt.pl |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Sales (sale_management)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 520 |
| Technical Name |
xpt_price_campaign |
| License | OPL-1 |
| Website | https://xpedyt.pl |
Price Campaign
Schedule future price changes for products and pricelists — reviewed, approved, applied automatically, and rolled back when the campaign ends.
Overview
Updating prices in Odoo is a manual operation: someone opens each product, edits the sale price, and saves. There is no way to prepare a batch of changes in advance, no approval step to catch mistakes before they go live, and no automatic way to restore prices once a promotion ends.
Price Campaign solves all of this. Create a campaign, set a start date and an optional end date, then define as many price change lines as needed — each with a fixed price, a percentage increase, or a percentage decrease. Odoo applies the changes automatically on the start date. If you also set an end date, Odoo automatically rolls all prices back to their original values when that date arrives — no manual cleanup required.
Campaign lifecycle
Each campaign moves through a clear sequence of states:
- Draft — the campaign is being built. Add or edit price change lines freely. The campaign has no effect on any prices at this stage.
- Pending Approval — the campaign has been submitted for review. A To-Do activity is automatically created and assigned to the first active Sales Manager. The campaign cannot be applied until it is approved.
- Approved — the campaign is cleared for application. Odoo will apply it automatically on the start date, or it can be applied immediately using the Apply Now button.
- Applied — all price changes have been written. The applied date and the user who triggered the action are recorded. Rollback is available until the end date (if set) or for 30 days from the apply date.
- Cancelled — the campaign was discarded, manually rolled back, or automatically expired when its end date passed.
Campaigns that do not require approval skip the Pending Approval state and can be approved directly from Draft.
Price change lines
Each line targets one product (or one pricelist item) and defines how its price should change. Three change types are supported:
- Fixed Price — set an exact new price regardless of the current value.
- Increase by % — raise the current price by the given percentage.
- Decrease by % — lower the current price by the given percentage.
Two computed columns — Current Price and New Price — are shown on every line so the user can see exactly what will happen before the campaign is applied. These values update live whenever the change type or value is edited.
The Add Bulk Lines button opens a wizard where a single change rule can be applied to multiple products at once. Choose specific products, a product category, or both — the wizard shows how many products match before generating the lines. One line per product is added to the campaign immediately.
Optional approval workflow
The Requires Approval checkbox on the campaign form controls whether a management review step is enforced. When enabled:
- Submit for Approval transitions the campaign to Pending Approval and creates a To-Do activity assigned to the first active Sales Manager. The activity deadline is set to the campaign's start date (or today if the date has already passed).
- The manager approves directly from the campaign form. Any open To-Do activities are marked as done automatically on approval.
- A campaign with this flag cannot be approved directly from Draft — it must go through the submission step first.
When the flag is disabled, any user can approve the campaign directly without submitting it.
End date and automatic expiry
The optional End Date field defines when a campaign's price changes should stop being active. When an end date is set:
- A daily cron job checks for applied campaigns whose end date has passed and automatically rolls back all prices to their values from before the campaign ran.
- The Rollback button remains available on the campaign form right up until the end date, giving the team a manual option to revert early if needed.
- After rollback, the campaign transitions to Cancelled and a chatter note records that the prices were automatically restored.
This makes the module suitable for time-limited promotions: set a start date and an end date, and the entire price change lifecycle — apply and revert — runs without any manual steps.
If no end date is set, the Rollback button remains available for 30 days after the campaign was applied. After that the button is hidden and any corrections must be made manually.
Price rollback
When a campaign is applied, each line records a snapshot of the price as it was before the change was written. This Was value is stored on the line and is never modified afterwards.
The Rollback button on the campaign form restores every product or pricelist item to its snapshotted value in a single operation, then transitions the campaign to Cancelled and posts a chatter note recording who performed the rollback.
Automatic application via scheduled jobs
Two daily cron jobs handle the campaign lifecycle automatically:
- Apply campaigns — finds all approved campaigns whose start date is today or earlier and applies them. Campaigns can also be applied immediately at any point after approval using the Apply Now button.
- Expire campaigns — finds all applied campaigns with an end date that has passed and rolls back their price changes automatically.
Each campaign is processed inside its own savepoint. A failure in one campaign is logged and does not block the others in the same run.
Product prices and pricelist items
The Apply To field on the campaign determines which price is updated when a line is applied:
- Product Sale Price — updates the standard sale price on the product template.
- Pricelist Items — updates the fixed price on a specific pricelist item. Select the target pricelist on the campaign and link each line to the correct pricelist item.
- Both — if the line has a pricelist item linked, that is updated; otherwise the product sale price is updated.
Requirements
- Odoo 19
- Module dependency:
sale_management - Module dependency:
product
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module