Odoo Help

0

How do I change a sequence? So that instead of MO/XXX, it shows JO/XXX ?(SOLVED)

By
Alcaline
on 8/3/14, 10:46 PM 2,206 views

Does anyone here knows how to change the name of a sequential???


1

Ray Carnes

--Ray Carnes--
16773
| 9 7 9
Atlanta, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 8/3/14, 11:14 PM

You can change the formatting of any sequence.

This includes Purchase Orders, Sales Orders, Delivery Orders, Manufacturing Orders, Invoices, etc.

Do this via the menu sequence  Settings -> Technical -> Sequences and Identifiers -> Sequences

For Invoices via the Sales Journal, you will see the following when you open the relevant record:

You can see that the only things you can incorporate into a sequence this way are:

  1. Fixed or date/time based prefix characters
  2. Fixed or date/time based suffix characters
  3. The total number of numerals in the number (padding) ie: 001 or 000001
  4. The increment used for the next number in the sequence
  5. The next number used for the numeric part of the sequence
  6. Whether to allow gaps in the sequence

You can see at the bottom the format for various components of the data and time.

 

0
Alcaline
On 8/4/14, 11:00 PM

My problem got solved by adding this code in my additional .xml then change the prefix from MO to JO. In my .py I add the _default for my fields that will going to use sequence:

.xml:

 <record id="mrp.sequence_mrp_prod_type" model="ir.sequence.type">
            <field name="name">Production order</field>
            <field name="code">mrp.production</field>
        </record>
        
        <record id="mrp.sequence_mrp_prod" model="ir.sequence">
            <field name="name">Production order</field>
            <field name="code">mrp.production</field>
            <field name="prefix">JO/</field>
            <field name="padding">5</field>
            <field name="number_next">1</field>
            <field name="number_increment">1</field>
        </record>

.py:

  _defaults ={
                'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/',
                }
       

 

0
Dimple
On 8/4/14, 5:26 AM

For this we only need the  sequence.xml and __openerp__.py files. 

example code : 

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="1">

        <!-- Sequences for crm.lead -->
     <!--    <record id="seq_type_lead_no" model="ir.sequence.type">
            <field name="name">Leadnumber</field>
           <field name="code">crm.lead</field> 
        </record> -->

        <record id="seq_lead_no" model="ir.sequence">
            <field name="name">Leadnumber</field>
            <field name="code">crm.lead</field>
            <field name="prefix">LN</field>
            <field name="padding">3</field>
            <field name="company_id" eval="False"/>
        </record>

    </data>
</openerp>

For changing MO to JO,first we have to delete the MO code from the sequences ( Settings -> Technical -> Sequences & Identifiers ->Sequences )

thanks dimple:)

Alcaline
on 8/4/14, 10:51 PM

thanks dimple:)

Alcaline
on 8/4/14, 10:52 PM

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

Question tools

2 follower(s)

Stats

Asked: 8/3/14, 10:46 PM
Seen: 2206 times
Last updated: 3/16/15, 8:10 AM