Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Manufactoring order sequence?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
mrpsequencenumbering
3 Respostes
8886 Vistes
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
Descartar
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
Descartar
Elevenmidia
Autor

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
Autor

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
Descartar
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
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
How to modify existing sequence parameters?
sequence account.invoice numbering
Avatar
Avatar
Avatar
2
d’abr. 24
18071
How to change Quality Control Point Sequence
mrp sequence quality
Avatar
0
de juny 19
4553
How to change the behavior of bank statement line numbering?
sequence bank_statement numbering
Avatar
0
de juny 15
6123
v 10: numbering sequence of invoices interrupted
sequence invoicing numbering jumps
Avatar
0
de juny 21
2319
Odoo 17 Bom can't import with Produit / ID externe
mrp
Avatar
Avatar
Avatar
2
d’ag. 25
2056
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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