AI Sales Assistant | Quotation Scoring, Product Suggestions & Sales Chat
by Steven Marp https://apps.odoo.com/apps/browse?order=Newest&repo_maintainer_id=512936$ 212.99
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
CRM (crm)
• Sales (sale_management) • Calendar (calendar) • Contacts (contacts) • Discuss (mail) • Invoicing (account) |
| Lines of code | 3242 |
| Technical Name |
sm_ai_sales |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/browse?order=Newest&repo_maintainer_id=512936 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
CRM (crm)
• Sales (sale_management) • Calendar (calendar) • Contacts (contacts) • Discuss (mail) • Invoicing (account) |
| Lines of code | 3242 |
| Technical Name |
sm_ai_sales |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/browse?order=Newest&repo_maintainer_id=512936 |
AI Sales Assistant
AI-powered quotation intelligence with deal scoring, product suggestions, customer insights, sales notes, and chat assistance
Watch the AI Sales Assistant in Action
See how AI scoring, product suggestions, quotation notes, and the floating sales chat work directly inside Odoo Sales.
Key Features
1 Deal Success PredictionScore each quotation from 0 to 100 based on customer history, order value, discount level, response time, product popularity, and customer engagement. Sales teams can focus on the deals that need attention. |
Know which quotations are most likely to close |
|
Recommend the next best products |
2 Smart Product SuggestionsSuggest upsell, cross-sell, bundle, and repeat-purchase products from customer history, similar customers, and best-selling items. Suggested products can be added to quotations in one click. |
3 AI-Generated Quotation NotesGenerate customer-ready quotation notes using professional, friendly, or persuasive sales tones. Notes are based on customer history, products, order amount, and discount context. |
Create customer-ready quotation text |
|
Understand customer buying patterns |
4 Customer IntelligenceReview total orders, revenue, average order value, buying frequency, price sensitivity, preferred products, preferred categories, and best day to contact each customer. |
5 AI Chat PanelAsk questions about the current quotation directly from the sale order. The assistant understands customer, products, amount, score, and order state to provide short, actionable sales guidance. |
Ask sales questions from each quotation |
|
Use OpenAI, Gemini, or compatible gateways |
6 Configurable AI ProvidersConnect OpenAI or Google Gemini from Odoo Settings. Configure model, API base URL, default note tone, automatic analysis settings, and token usage limit from one place. |
How It Works
|
1
Configure ProviderChoose OpenAI or Google Gemini and set the API key from Odoo Settings. |
2
Analyze QuotationOpen a quotation and run AI analysis to generate score, insight, suggestions, and notes. |
3
Close SmarterAdd suggested products, update notes, follow recommendations, and prioritize deals by score. |
Highlighted Features
Deal success score · Product suggestions · Upsell and cross-sell analysis · AI quotation notes · Customer buying patterns · Price sensitivity · Best contact day · AI chat panel · Sales recommendations · OpenAI support · Google Gemini support · Token usage tracking · Odoo 18 Sales and CRM integration
AI Sales Assistant - Odoo 18 User and Technical Guide
Table of Contents
- 1. Overview
- 2. What the Module Adds
- 3. Installation
- 4. Provider Configuration
- 5. Test Connection
- 6. Quotation Analysis Flow
- 7. Deal Score Details
- 8. Product Suggestions
- 9. Quotation Notes
- 10. AI Chat Panel
- 11. Customer Intelligence
- 12. Token Usage and Limits
- 13. Security
- 14. Provider and Model Notes
- 15. Troubleshooting
- 16. Upgrade and Cache Notes
- 17. Technical Reference
- 18. Compatibility
1. Overview
The AI Sales Assistant module adds AI-powered sales intelligence to Odoo Sales quotations.
It helps sales teams:
- Score quotation close probability.
- Generate product upsell and cross-sell suggestions.
- Generate customer-ready quotation notes.
- Understand customer buying behavior.
- Chat with an AI assistant from the quotation form.
- Track AI token usage and provider configuration.
The module is designed for Odoo 18 Sales users who want practical AI inside their daily quotation workflow, without leaving Odoo.
2. What the Module Adds
Sale Order Enhancements
The module extends sale.order with AI fields and actions:
- ai_score: close probability score from 0 to 100.
- ai_score_color: status color used by the score widget.
- ai_notes: generated quotation notes.
- ai_notes_tone: tone used to generate notes.
- ai_suggestions_json: raw AI response data for product suggestions.
- ai_suggestion_ids: structured product suggestion records.
- ai_insight: short AI insight for the current quotation.
- ai_recommendations: JSON list of sales recommendations.
- ai_last_analyzed: last AI analysis timestamp.
- customer_insight_id: link to customer intelligence.
Quotation Form UI
The quotation form receives:
- AI Analyze action button.
- AI score badge in the quotation header.
- AI Assistant notebook page.
- Floating AI assistant panel.
- Product suggestion list.
- AI notes editor.
- Customer insight action.
Settings UI
The module adds an AI Sales Assistant block in Odoo Settings with:
- Provider selection.
- OpenAI configuration.
- Google Gemini configuration.
- Custom model ID support.
- Test connection action.
- Auto-analysis toggles.
- Default note tone.
- Token usage counter.
- Monthly token limit.
3. Installation
- Copy the sm_ai_sales folder into an Odoo addons path.
- Restart Odoo.
- Update Apps List.
- Install AI Sales Assistant.
Command-line example:
python3 ~/odoo/odoo-18/odoo-server \ -c ~/odoo/conf/odoo.conf \ -d your_database \ -i sm_ai_sales \ --stop-after-init \ --no-http
4. Provider Configuration
OpenAI
To use OpenAI:
Open Settings -> AI Sales Assistant.
Select OpenAI (ChatGPT).
Enter the OpenAI API key.
Select an OpenAI model.
Keep API Base URL as:
https://api.openai.com/v1
Click Save.
Click Test Connection.
OpenAI-Compatible Gateways
For OpenAI-compatible gateways, local routers, proxies, or custom LLM endpoints:
Select OpenAI (ChatGPT).
Enter the gateway API key.
Set API Base URL to the gateway URL, for example:
http://localhost:20128/v1
Select a listed model or choose Custom Model ID.
Enter the gateway model ID.
Save and test the connection.
The module calls:
POST {API Base URL}/chat/completions
Google Gemini
To use Google Gemini:
- Open Settings -> AI Sales Assistant.
- Select Google Gemini.
- Enter the Gemini API key from Google AI Studio.
- Select a Gemini text model.
- Click Save.
- Click Test Connection.
Recommended free-tier model:
Gemini 2.5 Flash Lite
The module calls:
POST https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent
Custom Gemini Model
If Google AI Studio exposes a model that is not yet listed:
- Select Custom Model ID.
- Enter the exact Gemini API model ID.
- Save and test the connection.
5. Test Connection
The Test Connection button sends a short test prompt to the selected provider.
Successful result:
- The provider accepts the API key.
- The selected model is available.
- The current project has quota.
- Odoo can reach the external API.
Common failures:
- Missing or wrong API key.
- OpenAI API credits not active.
- Gemini quota exceeded.
- Model not available in the current billing tier.
- Provider temporarily under high demand.
- Server cannot reach the internet.
- Custom gateway URL is unreachable.
6. Quotation Analysis Flow
When a user clicks AI Analyze on a quotation, the module runs this workflow:
- Load the selected AI provider from system parameters.
- Check API key configuration.
- Check monthly token limit.
- Calculate deal success prediction.
- Generate product suggestions.
- Generate quotation notes if notes are empty.
- Store the AI score, insight, recommendations, suggestions, and last analysis timestamp on the quotation.
- Show a success notification.
The main method is:
sale.order.action_ai_analyze()
It uses:
ai.sales.service.predict_deal_success() ai.sales.service.get_product_suggestions() ai.sales.service.generate_quotation_notes()
7. Deal Score Details
The deal score is a deterministic 0-100 value. It combines several business signals from Odoo data.
Customer History Score
Based on confirmed or done sale orders from the same customer:
- 10 or more orders: high score.
- 5 or more orders: strong score.
- 2 or more orders: medium score.
- 1 order: low-medium score.
- No orders: new customer score.
Order Value Score
Compares the current quotation amount with the customer's historical average order value.
The score is higher when the quotation is close to the customer's usual order size and lower when the quotation is much higher than historical behavior.
Discount Score
Uses average discount across quotation lines.
The module treats moderate discounts as useful sales leverage, but very large discounts can lower confidence because they may indicate risk.
Response Time Score
If the quotation is linked to a CRM opportunity, the module compares:
- CRM lead creation date.
- Quotation creation date.
Fast quotation response improves the score.
Product Popularity Score
Checks how often the quotation products were sold in confirmed or done sale orders.
Popular products increase confidence. New or rarely sold products lower confidence.
Customer Engagement Score
Uses customer profile completeness and recent engagement:
- Email.
- Phone or mobile.
- Address.
- Company customer.
- Recent messages.
Adjustment Score
The module adds small business-rule adjustments:
- Customer has email and phone.
- Quotation has a valid expiration date.
- Quotation has order lines.
- Discount factor is favorable.
- Zero-amount quotations are penalized.
8. Product Suggestions
Product suggestions are generated by AI using structured quotation and customer context.
Context Sent to AI
The module sends:
- Customer name.
- Customer industry.
- Current quotation products.
- Last customer purchases.
- Similar customer purchases.
- Best-selling products.
Expected AI Response
The AI is instructed to return valid JSON:
{ "suggestions": [ { "product_name": "Product Name", "reason": "Why this product fits", "type": "upsell", "confidence": 85 } ], "insight": "One sentence insight about this customer" }
Validation
Before creating suggestion records, the module validates:
- Suggestion type.
- Confidence value.
- Product name length.
- Product match in product.product.
Adding Products
Users can click Add on a suggestion. If a matching product is found, the module creates a new sale.order.line with quantity 1 and marks the suggestion as added.
9. Quotation Notes
The AI note generator creates quotation text using:
- Customer name.
- Returning-customer status.
- Products.
- Total amount.
- Discount information.
- Selected tone.
Supported tones:
- Professional.
- Friendly.
- Aggressive Sales.
Notes are stored in:
sale.order.ai_notes
Users can regenerate notes from the quotation form, AI Assistant tab, or floating AI panel.
10. AI Chat Panel
The floating AI panel is an OWL field widget mounted on the quotation form.
It provides:
- Chat with the assistant.
- Quick Analyze action.
- Quick Score refresh.
- Quick Suggest action.
- Quick Notes generation.
- Suggestions tab.
- Notes tab.
- Tips tab.
- Customer profile summary.
Chat Context
When a user sends a chat message, the module sends the AI:
- Customer name.
- Quotation amount.
- First quotation products.
- Current AI score.
- Quotation state.
- User message.
The assistant is instructed to give short, practical sales guidance.
Frontend Files
Main frontend files:
static/src/js/ai_panel/ai_sales_panel.js static/src/js/ai_panel/ai_sales_panel.xml static/src/js/ai_score_widget/ai_score_widget.js static/src/js/ai_score_widget/ai_score_widget.xml static/src/scss/ai_panel.scss
11. Customer Intelligence
Customer insights are stored in:
ai.customer.insight
Computed fields include:
- Total orders.
- Total revenue.
- Average order value.
- Buying frequency.
- Days since last order.
- Price sensitivity.
- Average discount requested.
- Preferred products.
- Preferred categories.
- Best contact day.
Buying Frequency
The module calculates average days between confirmed orders:
- Weekly.
- Bi-weekly.
- Monthly.
- Quarterly.
- Yearly.
- Irregular.
Price Sensitivity
The module calculates average discount requested:
- More than 15 percent: high price sensitivity.
- More than 5 percent: medium price sensitivity.
- Otherwise: low price sensitivity.
Preferred Products and Categories
The module counts products and categories from confirmed or done sale orders and stores the top results.
Best Contact Day
The module counts historical order days and picks the weekday with the highest frequency.
12. Token Usage and Limits
The module tracks provider token usage in:
sm_ai_sales.total_tokens_used
The monthly limit is configured in:
sm_ai_sales.monthly_limit
If the total token usage reaches the configured monthly limit, AI calls are blocked until the counter is reset or the limit is increased.
Set monthly limit to 0 for unlimited usage.
The Reset Counter button resets total usage to 0.
13. Security
Access Rights
Users can:
- Read, create, and update AI suggestions.
- Read, create, and update customer insights.
- Use the regenerate notes wizard.
Managers can:
- Delete suggestions.
- Delete customer insights.
- Review all AI suggestions.
Record Rules
Sales users see suggestions linked to their own quotations. Managers can see all suggestion records.
API Key Storage
API keys are stored in ir.config_parameter and displayed as password fields in settings.
Do not publish screenshots that reveal API keys. If a key is exposed, delete it and create a new key.
14. Provider and Model Notes
OpenAI
OpenAI API billing is separate from ChatGPT Plus. A ChatGPT Plus subscription does not include OpenAI API credits.
For standard OpenAI usage:
API Base URL = https://api.openai.com/v1
For local routers or compatible gateways, use the gateway base URL.
Google Gemini
Gemini free tier quotas vary by model, project, region, and billing tier. A key can be valid while a model still fails because quota is 0, quota is exhausted, or the model is under temporary high demand.
If Gemini 2.5 Flash fails due to high demand, try:
Gemini 2.5 Flash Lite
15. Troubleshooting
OpenAI: Quota Exceeded
Cause:
- OpenAI API credits are not active.
- API billing has no remaining balance.
- Project has no usable quota.
Fix:
- Add credits in OpenAI Platform.
- Check project billing.
- Confirm the API key belongs to the project with billing.
Gemini: Quota Exceeded
Cause:
- Free tier quota is exhausted.
- Selected model has 0 quota.
- Google project needs billing for that model.
Fix:
- Check Rate Limit in Google AI Studio.
- Use a model with non-zero RPM/RPD.
- Use Gemini 2.5 Flash Lite for free-tier testing.
- Enable billing if production stability is needed.
Gemini: High Demand
Cause:
- Google temporarily throttles the selected model.
Fix:
- Wait a few minutes.
- Switch to a lighter model.
- Avoid repeatedly clicking Test Connection.
Custom Gateway Not Working
Check:
- Gateway is running.
- Base URL ends with /v1 if it follows OpenAI convention.
- Odoo server can reach the gateway URL.
- API key is correct.
- Model ID exists in the gateway.
AI Suggestions Empty
Possible causes:
- No product history.
- No best-seller data.
- AI returned invalid JSON.
- API quota or provider error.
Fix:
- Add confirmed sale orders for demo data.
- Use a reliable model.
- Check Odoo server logs.
16. Upgrade and Cache Notes
After changing Python fields, XML views, or assets, upgrade the module:
python3 ~/odoo/odoo-18/odoo-server \ -c ~/odoo/conf/odoo.conf \ -d your_database \ -u sm_ai_sales \ --stop-after-init \ --no-http
Then restart Odoo.
If frontend changes do not appear:
- Hard refresh the browser.
- Clear Odoo assets if needed.
- Restart Odoo in development mode when actively editing assets.
17. Technical Reference
Models
ai.sales.service ai.sales.suggestion ai.customer.insight ai.regenerate.wizard sale.order res.partner res.config.settings
Important Methods
sale.order.action_ai_analyze() sale.order.action_ai_generate_notes() sale.order.action_ai_get_suggestions() sale.order.action_ai_predict_score() sale.order.get_ai_panel_data() sale.order.ai_chat_message() ai.sales.service._call_ai_api() ai.sales.service._call_openai_api() ai.sales.service._call_gemini_api() ai.sales.service.predict_deal_success() ai.sales.service.get_product_suggestions() ai.sales.service.generate_quotation_notes() ai.sales.suggestion.create_from_ai_response() ai.customer.insight._compute_insights()
System Parameters
sm_ai_sales.ai_provider sm_ai_sales.openai_api_key sm_ai_sales.ai_model sm_ai_sales.custom_model sm_ai_sales.api_base_url sm_ai_sales.gemini_api_key sm_ai_sales.gemini_model sm_ai_sales.gemini_custom_model sm_ai_sales.auto_analyze sm_ai_sales.auto_suggestions sm_ai_sales.default_tone sm_ai_sales.total_tokens_used sm_ai_sales.monthly_limit
18. Compatibility
- Tested on Odoo 18.0 Community & Enterprise.
- Requires Odoo Sales, CRM, Product, and Web.
- Uses standard Odoo ORM, views, access rights, res.config.settings, OWL components, and backend asset bundles.
- External AI provider availability depends on API key, quota, network, selected model, and billing tier.
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