Odoo Help

Welcome!

This community 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.

0

How to modify existing sequence parameters?

By
Anabela Damas
on 11/7/13, 10:19 AM 2,170 views

Hi,

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>

to :

            <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!

1

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 11/7/13, 6:41 PM

On this case if you want to overwrite it you have to follow the following steps:

  1. add account to dependencies on your module (__openerp__.py)
  2. Look for the original code, in this case: (/account/data/account_data.xml)
  3. Copy the entire record that you want to change and paste it on your module
  4. Add the module name of the module account on your module (change sequence_sale_journal -> account.sequence_sale_journal)
  5. Modify what you need to modify
  6. Install your module

Account 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>

Your module

<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>

Doesn't work! I did everything that you say but the first invoice has this : SAJ/2013/0001.

Versão Integral, Anabela Damas
on 11/11/13, 6:40 AM

Did you create the invoice before installing my code?

GH Mediacloud, Grover Menacho
on 11/11/13, 7:29 AM

No! First I install the module then create the invoice, but sequences are still the same way.

Versão Integral, Anabela Damas
on 11/11/13, 1:08 PM
0
PT SIVI
On 12/27/13, 4:07 AM

Just simply

Go to Setting->Technical->Sequence and Identifiers->Sequences

Find Sales Order

I want by programing...

Versão Integral, Anabela Damas
on 1/2/14, 5:51 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 11/7/13, 10:19 AM
Seen: 2170 times
Last updated: 3/16/15, 8:10 AM