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.
I'm trying to change the sequences from delivery orders, invoices, refunds . It's easy by the interface, but I need this changes in code for all my installations to have all the same sequence, and to avoid to configure everything in each installation and have the risk to forget of something.
For the example of account.invoice, I need to change the padding, and the prefix from :
<field name="prefix">SAJ/%(year)s/</field> <field name="padding">4</field>
<field name="prefix">SAJ/%(year)s</field> <field name="padding">6</field>
The prefix without the last "/" and instead of "4" in padding have "6".
I want to do this configurations in my new module but I don't know how to change this to parameters from existing sequences?
Thanks in advance!
On this case if you want to overwrite it you have to follow the following steps:
- add account to dependencies on your module (__openerp__.py)
- Look for the original code, in this case: (/account/data/account_data.xml)
- Copy the entire record that you want to change and paste it on your module
- Add the module name of the module account on your module (change sequence_sale_journal -> account.sequence_sale_journal)
- Modify what you need to modify
- Install your module
<record id="sequence_sale_journal" model="ir.sequence"> <field name="name">Account Default Sales Journal</field> <field eval="3" name="padding"/> <field name="prefix">SAJ/%(year)s/</field> </record>
<record id="account.sequence_sale_journal" model="ir.sequence"> <field name="name">Account Default Sales Journal</field> <field eval="6" name="padding"/> <field name="prefix">SAJ/%(year)s/</field> </record>
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: 11/7/13, 10:19 AM|
|Seen: 2704 times|
|Last updated: 3/16/15, 8:10 AM|