hi , i want to create a new menu contract that uses the same information as quotation, how can i do it knowing that i am using odoo online. I want the menu to have its own reference like C0001.
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
This question has been flagged
Creating a new menu item in Odoo that uses the same information as a quotation but with a different reference (e.g., C0001) involves a few steps. You'll need to customize Odoo to achieve this, and the process generally involves configuring models and views, and possibly some Python code if the customization is beyond standard settings. Here’s a general guide to help you with this process:
Steps to Create a New Menu Item for Contracts in Odoo
- Define a New Model for Contracts:
- Go to Settings > Technical > Database Structure > Models.
- Create a new model, or if you prefer to use existing models, you can duplicate and modify the quotation model.
- Create a New Menu Item:
- Go to Settings > Technical > User Interface > Menu Items.
- Create a new menu item for your contract. Link it to the model you created or customized.
- Modify the Views:
- Go to Settings > Technical > User Interface > Views.
- Create or modify existing views to suit the layout you need for contracts. You can base these views on the quotation views but make adjustments as necessary.
- Add a Unique Reference Field:
- In your new or modified model, ensure there is a field for the unique reference number (e.g., C0001).
- You may need to add a custom field in the form view to handle this reference.
- Automate the Reference Generation:
- You can add Python code to automatically generate and assign the unique reference number. This is typically done in the model’s create method or via a custom method.
- Here’s a simple example of how you might do this:
pythonCopy codefrom odoo import models, fields, api class Contract(models.Model): _name = 'your.contract.model' _inherit = 'sale.order' # If you are inheriting from sale.order reference = fields.Char(string='Reference', required=True, copy=False, readonly=True, default='C0001') @api.model def create(self, vals): if vals.get('reference', 'C0001') == 'C0001': vals['reference'] = self.env['ir.sequence'].next_by_code('your.contract.sequence') or 'C0001' return super(Contract, self).create(vals)
- Set Up Sequences:
- Define a sequence for your new model if you want the reference numbers to be automatically incremented.
- Go to Settings > Technical > Sequences & Identifiers > Sequences and create a new sequence.
- Test Your New Menu and Model:
- After setting up the menu, model, and views, test creating and managing contracts to ensure everything works as expected.
- Check if the references are generated and displayed correctly.
Important Notes:
- Customization Complexity: Depending on your needs, customization might require development skills. If you're not familiar with coding or Odoo’s internal structure, consider seeking help from an Odoo consultant or developer.
- Testing: Always test new configurations in a staging environment before applying them to your live system to prevent any disruptions.
- Documentation: Refer to Odoo's documentation or community forums for detailed guides and examples specific to your Odoo version and needs.
By following these steps, you should be able to create a new menu for contracts in Odoo with its own reference system similar to quotations.
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