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 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 1,957 views

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


1

Ray Carnes

--Ray Carnes--
15677
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

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. 

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

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

2 follower(s)

Stats

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