Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Purchase (purchase)
• Sales (sale_management) • Invoicing (account) • Discuss (mail) |
Lines of code | 169 |
Technical Name |
sale_purchase_assistant |
License | OPL-1 |
Website | https://cdb.solutions/ |
Versions | 17.0 18.0 19.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Purchase (purchase)
• Sales (sale_management) • Invoicing (account) • Discuss (mail) |
Lines of code | 169 |
Technical Name |
sale_purchase_assistant |
License | OPL-1 |
Website | https://cdb.solutions/ |
Versions | 17.0 18.0 19.0 |
Assistant Feature for Sales and Purchases in Odoo 17.0
By CDB Solutions
This documentation describes a custom feature implemented for Odoo 17.0, which introduces the concept of "assistants" for sales and purchase orders. Assistants are individuals who can be associated with orders, and their names can be displayed on order documents. This feature helps track sales and purchases made by people who don't have a user profile. While the assistants are managed from the Sales module, the feature is fully functional in both the Sales and Purchase modules. It can easily be extended to other modules with Odoo studio.
Configuration
The configuration for assistants is managed exclusively through the Sales module, providing a centralized location for setup, even though the feature impacts both Sales and Purchase modules.
Creating Sale Assistants
- Navigate to the Sales module.
- Go to the Configuration menu.
- Select "Sale Assistants" (or the appropriate menu item as per the implementation).
- Administrators can create new assistant records here. Each assistant typically includes a name and possibly additional details, forming a selectable list for use in orders.


Setting the Assistant User
You can set a user profile that will force the user to select an assistant on the orders.


- This profile is configured in the user settings.
- A safety mechanism ensures that only one assistant profile exists at any time, preventing multiple conflicting profiles and maintaining consistency across the system.

Usage in Sales and Purchases
The assistant feature integrates seamlessly into the form views of both sales and purchase orders, enhancing the user interface and workflow.
- Form Views:
- On the sale order form, a new field to select an assistant is displayed under the "Salesperson" field.
- On the purchase order form, a similar field to select an assistant appears under the "Buyer" field.
- If the salesperson (for sales) or buyer (for purchases) is set to a specific value set in the user settings, the assistant field becomes mandatory. This ensures that an assistant is selected when required by the workflow.
- Workflow:
- Assistants are selected from a list populated by the "Sale Assistants" configured in the Sales module.
- When an assistant is selected, it influences the display of the "Salesperson" or "Buyer" on documents, adapting the name based on the chosen assistant.
Reporting
The PDF reports for sales and purchase orders have been customized to handle the display of assistant and salesperson/buyer information according to a specific logic.
- Logic for Display:
- If an assistant is selected on the order, the assistant's name is displayed on the PDF.
- If no assistant is selected, the system checks for a salesperson (for sales orders) or buyer (for purchase orders). If one is present, their name is displayed.
- If both the assistant and salesperson/buyer fields are empty, no name is displayed in that section of the PDF.
- Requests for Quotation (RFQs):
- For RFQs, neither the assistant nor the buyer is displayed. This aligns with Odoo's default behavior for draft purchase orders.

Additional Notes
- Centralized Management: Assistants are managed exclusively from the Sales module, emphasizing a single point of configuration, yet the feature operates effectively across both Sales and Purchase modules.
- Conditional Mandatory Field: The assistant field's mandatory status is triggered by specific values in the salesperson or buyer field (e.g., "Assistante"), ensuring accurate personnel tracking when needed.
- Safety Mechanism: The restriction to a single assistant profile at a time enhances system reliability and prevents configuration errors.
This feature provides Denis Pesage with a tailored solution to manage assistant names on sales and purchase orders, reflecting their operational needs within Odoo 17.0.
Support
If you encounter any issues or need translations, please contact me by email: louis@cdb.solutions
Collaboration
If you are interested in collaborating with us, or need developers for your own projects, please contact me by email: louis@cdb.solutions

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