Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Manufactoring order sequence?

Subscribe

Get notified when there's activity on this post

This question has been flagged
mrpsequencenumbering
3 Replies
8874 Views
Avatar
Elevenmidia

Dear all, I need your help with a problem I am having on Manufacturing Order Sequence Number The problem is that, everytime I click Create and then Discard the document, the sequence number increases. This is bad, because the Manufacturnig Order was discarded and not Saved. If I click on Create and then Discard several times, the sequence number will increase the number of times clicked.

How can I prevent OpenERP, from doing it and just increase the number when Manufacturing Order is saved?

I have been searching the forum, and found a "closed" post:

help.openerp.com/question/22373/control-on-autogenerated-sequence-number/

Unfortunetly this is not very clear for a newbie like me.

What I have tried to do:

  1. On my mrp.py file:

Found the line " 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/', " on my "class mrp_production(osv.osv)". The full _defaults statement is below.

_ defaults = {
    'priority': lambda *a: '1',
    'state': lambda *a: 'draft',
    'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
    'product_qty':  lambda *a: 1.0,
    'user_id': lambda self, cr, uid, c: uid,

    THE BELOW LINE

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

    THE ABOVE LINE

    'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
    'location_src_id': _src_id_default,
    'location_dest_id': _dest_id_default
}

But the problem is that I do not know how will I override de create() method according to instructions from the post. I do not find a create() method on mrp.py file. The instructions say that I should override this method with the following code:

(where to put this code)

def create(self,cr,uid, vals,context=None):
    vals = {}
if context is None:
    context = {}
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'object.object')
return super(object, self).create(cr, uid, vals, context=context)

" Paulo

0
Avatar
Discard
Avatar
Ray Carnes
Best Answer

You can change the Implementation option on the sequence to NOT ALLOW gaps in the sequence.

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

The example below is for Invoices via the Sales Journal, but if you open the sequence for Manufacturing Orders you will see the same type of record:

image description

You can see the things you can modify about a sequence 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 (this is what you want to modify)

0
Avatar
Discard
Elevenmidia
Author

I have tried that already Ray. The problem is that the sequence number is achieved when you click Create and not when you save the production order. If you click on Create and Discard several times you will see that the sequence number increases everytime. This way, when you click on save the manfactoring order will be saved with the last number received. I need to change it in ways to get the correct number just when you say Save or Confirm Production.

Ray Carnes

Understood. Take a look at the way Invoice numbers are assigned, at SAVE time, not at CREATE time.

Elevenmidia
Author

Yes Ray, I have noticed that. The invoice number is achieved at save time and the manufacturing order gets the number at the create time. This is what I really need to change. I need to change the mrp behavior to achieve the number on save time and not at create time. Thank you once again

Avatar
Daniel Santos
Best Answer

Same problem here. I found this answer, maybe could help you:

http:// help.openerp.com/question/22373/control-on-autogenerated-sequence-number/

Thanks!

0
Avatar
Discard
Avatar
Med Said BARA
Best Answer

You should read this response on stackoverflow

The problem is more general read this

Patching, is not a solution in this case.

The question should be raised for the core team in Launchpad .

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
How to modify existing sequence parameters?
sequence account.invoice numbering
Avatar
Avatar
Avatar
2
Apr 24
18066
How to change Quality Control Point Sequence
mrp sequence quality
Avatar
0
Jun 19
4536
How to change the behavior of bank statement line numbering?
sequence bank_statement numbering
Avatar
0
Jun 15
6119
v 10: numbering sequence of invoices interrupted
sequence invoicing numbering jumps
Avatar
0
Jun 21
2318
Odoo 17 Bom can't import with Produit / ID externe
mrp
Avatar
Avatar
Avatar
2
Aug 25
2052
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now