Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Here is a solution. I think you already solve this problem though.
I guess there's no way to inherit a exists sequence record.
You can write a new sequence.xml below:
<?xml version="1.0" encoding="utf-8"?>
<record id="seq_new_sale_order" model="ir.sequence">
<field name="name">Sales Order</field>
<field name="company_id" eval="False"/>
See this line: <field name="code">new.sale.order</field>
I set field's value to new.sale.order
You should set a name as you want.
And override a create method in sale.order
from openerp import api, models, _
_inherit = 'sale.order'
def create(self, vals):
record = super(SaleOrder, self).create(vals)
record['name'] = self.env['ir.sequence'].next_by_code('kinder.sale.order') or _('New')
See : record['name'] = self.env['ir.sequence'].next_by_code('kinder.sale.order') or _('New')
You can input sequence new.sale.order by using next_by_code method.
I think there is no way to inherit a sequence xml files.
Instead, you can override a create method.
Have a nice day!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/26/14, 10:21 AM|
|Seen: 1159 times|
|Last updated: 6/21/17, 3:11 AM|