Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Manufactoring order sequence?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
mrpsequencenumbering
3 Respuestas
8871 Vistas
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
Mejor respuesta

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

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

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
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
How to modify existing sequence parameters?
sequence account.invoice numbering
Avatar
Avatar
Avatar
2
abr 24
18029
How to change Quality Control Point Sequence
mrp sequence quality
Avatar
0
jun 19
4530
How to change the behavior of bank statement line numbering?
sequence bank_statement numbering
Avatar
0
jun 15
6112
v 10: numbering sequence of invoices interrupted
sequence invoicing numbering jumps
Avatar
0
jun 21
2315
Odoo 17 Bom can't import with Produit / ID externe
mrp
Avatar
Avatar
Avatar
2
ago 25
2051
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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