Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to add a new status to the sales app(quotation) using studio?

Subscribe

Get notified when there's activity on this post

This question has been flagged
sale.order.formsale.orderdeveloperv14
2 Replies
4770 Views
Avatar
Abdul Razak

Can anyone help me to add a new status in the existing status bar in the quotation. I am using odoo version 14 enterprise edition.

Many thanks.

1
Avatar
Discard
Avatar
Gopakumar N G
Best Answer

You can use the selection_add property in a field definition for achieving this.

state = fields.Selection(selection_add=[('new_status', 'New Status')]

You can add the above code in a new module and also need to add it in the form view by inheriting it.


You need to create a new module for doing the above. You can check the official documentation for getting started with Odoo module development( Module development ). Then inside your module you need to inherit the "sale.order" model and add the field as suggested above. After that you need to add it in the form view of sales order(in an XML file) to see the field in the UI. You can check the documentation for inheritance here Inheritance


Detailed:

Create a folder inside your addons(or create a folder outside of it naming 'custom_addons' and add it in your addons_path) naming 'sale_order_new_status'. Inside that folder add an __init__.py file and __manifest__.py file. In the __initt__.py file you need to import the python files you are going to use for the new module. In the manifest file you can specify the module details and also add the XML files (Manifest File). Then add two folders naming 'models' and 'views' inside your module.

Inside the models folder add two python files naming __init__.py and sale.py. In the '__init__.py' file inside your module add the following line:

from . import models

Then in the __init__.py file inside models folder add the following line:

from . import sale

Then in the sale.py file add the following:

from odoo import fields, models
class SaleOrder(models.Model):
    _inherit = "sale.order"
    state = fields.Selection(selection_add=[('new_status', 'New Status')]


Then add the view inheritance in the sale_views file inside views directory and also mention the file name inside data section of the manifest file.


Then add the file to the manifest file(data section). Then you can go to "Update apps list" inside the Apps menu and then search for your module and install it. You may also need to add python methods for the transition from and to the new status added.

1
Avatar
Discard
Abdul Razak
Author

Since I am new to odoo can you help me where we can put the code and how to inherit it?

Gopakumar N G

I have updated the answer. Hope you can use it to add the new status.

Avatar
Asha
Best Answer

Inherit model sale.order

then add state=fields.Selection(selection_add=[('new_status', 'New Status')]  in .py 

Inherit the form view sale.view_order_form and add the new status inside the statusbar_visible

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
How to show sales/purchase (order/quotation) to the new company?
salesteams forum sale.order.form developer v14
Avatar
Avatar
Avatar
2
May 22
3091
I need a today filter with confirmed sale order. Solved
filter sale.order developer odoo v14
Avatar
Avatar
1
Apr 22
2701
Modificación Lista de Productos en una Orden de Venta Solved
sale.order.line sale.order.form sale.order
Avatar
Avatar
2
Apr 25
1534
Issue with amount_untaxed field value getting overwritten after saving in sale order module in Odoo14
sale.order compute v14
Avatar
0
Jan 24
169
In which method and module is created new delivery from sale order? Solved
delivery sale.order v14
Avatar
Avatar
1
Oct 21
5519
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now