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

how deploy sequences to the records in my particular module...

Suscribirse

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

Se marcó esta pregunta
sequencesodoo9
4 Respuestas
7513 Vistas
Avatar
Alfa y Omega Pachuca

In Odoo 9, i created a module name "library", but how i can deploy sequences for my personal module ("library").

In Settings/Sequences i created the sequence "BKS" but how i can married this sequences with the records in my module ("library").

I need to see the sequence in my module tree view, like the sequences in Sale Order tree view (SO001).

My module tree view is working fine, i just need add the sequence column field BKS001...

***Update*** 10/dic/15: WORKING !!! MODULE SAMPLE TO ADD SEQUENCES TO CUSTOM MODULE.

Thank you Axel for you help, if someone needs to add sequences to his records can use this module as a guide:

http://www.clasificadoshidalgo.com/tmp/odoo9/sequencesincustommodule.tar.gz


0
Avatar
Descartar
Avatar
Axel Mendoza
Mejor respuesta

@Carlos

You need to get the next value of the sequence and you could do it at different moments like:
-   Using a default value for a field, not recomended because will move the sequence numbers even if the record is not saved
-   On the create method, get the value and assign it to the field in the vals dict.

-   On a button like the confirm button on Sale Orders, get the value and assign it to the field in the vals dict used for call the write method.
To get the sequence value of a sequence with code(type of sequence) = library.sequence" you could do it like:

next_value = self.env['ir.sequence'].next_by_code('library.sequence') or '/'

Hope this helps

***Update***

Just put a label like in sale.order view

<h1>

<label string="Quality"/>

<field name="seq" class="oe_inline" readonly="1"/>

</h1>

1
Avatar
Descartar
Alfa y Omega Pachuca
Autor

i have a module name "quality" (this module is working good). models.py code:

# -*- coding: utf-8 -*-
from openerp import models, fields, api
class myquality(models.Model):
	_name = 'myquality.myquality'
	product_sn = fields.Char(string='Serial Number', required=True,)
	date = fields.Date(string='Date')
	description = fields.Text('Notes')
templates.xml code:

    
		
		
		
		
		
        
            Quality
            myquality.myquality
            tree,form
        
		
        
 		
        
            view.quality.fdi.tree
            myquality.myquality
            
                
					
                    
                
            
        
 		
        
            view.quality.fdi.form
            myquality.myquality
            
                
                    
                        
                            
								                               
                                
								
                            
                        
                        
                            
                                
                            
                        
                    
                
            
        
    
then i have another module name "mysecuencia" inherits my quality, the sequence must be assigned up when the record is written. the module name "mysecuecia" add the sequences to settings/sequences and then i need add the sequences value to the "myquality" tree view but in this step i do not know how do that. __openerp__.py code:
...
'data': [
        # 'security/ir.model.access.csv',
        'views.xml',
        'templates.xml',
		'secuencias.xml',
    ],
...
models.py code:
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class mysecuencia(models.Model):
	_inherit = 'myquality.myquality'
	fdi_code = fields.Char ('FDI Code', size=6, readonly=True)
	def create(self, cr, uid, vals, context=None):
		vals['fdi_code']=self.pool.get('ir.sequence').get(cr, uid,'myquality.myquality')
		res=super(myquality_myquality, self).create(cr, uid, vals)
		return res
secuencias.xml code:

    
 		
        
            FDI Code
            myquality.myquality
			TRUE
			FDI
			1
			1
            3
			standard
        
        


		
			my.secuences.in.fdi.tree.inherit
			myquality.myquality
			
			
				
					
				
			
		
    

in templates.xml there are nothing.
Alfa y Omega Pachuca
Autor

Axel, ca you donwload my modules at: http://clasificadoshidalgo.com/tmp/odoo9/modules.tar.gz The module myquality works fine The module mysecuencia must: 1.- Add a sequence "FDI" to settings/sequences

Axel Mendoza

I made some changes to the code of your module mysecuencia. Basically I add a new field "seq" and override the create method to show you what I told you on my answer. You can donwload it from
http://filesftp.soltein.org/files/mysecuencia.zip Don't forget to upvote and accept the answer if was helpful to you

Alfa y Omega Pachuca
Autor

Axel, Thank you very much :-). It works. When i save the new record, the title name is "Quality / myquality.myquality,1" Do you know how put the title like "Quality / FDI001" just like sale order "Quotation / SO001"

Axel Mendoza

Just put a label, see the answer update since I cannot put html code in comments

Alfa y Omega Pachuca
Autor

Thank you Axel, in this picture i show you what title i need to change to Quality / FDIXXX: http://clasificadoshidalgo.com/tmp/odoo9/title.jpg if i put you previus code just add a white line in the top of the form with label "Quality". Thank you for you help.

Avatar
Alfa y Omega Pachuca
Autor Mejor respuesta

Axel, ca you donwload my modules at: http://clasificadoshidalgo.com/tmp/odoo9/modules.tar.gz

The module myquality works fine

The module mysecuencia must:

1.- Add a sequence "FDI" to settings/sequences <--works fine

2.- Add a column "hello" to the tree view myquality (this is for test only) <--works fine

3.- Add a column "FDI Number" to the tree view myquality with the sequences of the records in myquality <-- I DO NOT KNOW HOW DO THIS.

Axel, the sequence number must be assigned up after the record is written, exactly like in quotation SO001 in the case of myquality module must be after the record was created, in the myquality tree view must be something like FDI001.

***Update*** 10/dic/15: WORKING !!! MODULE SAMPLE TO ADD SEQUENCES TO CUSTOM MODULE.

Thank you Axel for you help, if someone needs to add sequences to his records can use this module as a guide:

http://www.clasificadoshidalgo.com/tmp/odoo9/sequencesincustommodule.tar.gz

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 get data n view using custom widget in odoo 9
odoo9
Avatar
0
sept 23
2842
How to get data n view using custom widget in odoo 9
odoo9
Avatar
0
sept 23
2532
sequence prefix. Resuelto
sequences
Avatar
Avatar
Avatar
3
sept 23
5166
How to Remove " ADD NEW COLUMN " from task kanban view of Project Module? Resuelto
odoo9
Avatar
Avatar
Avatar
2
jun 25
12179
How to edit the product website description Resuelto
odoo9
Avatar
Avatar
Avatar
Avatar
Avatar
6
oct 23
23492
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.

Sitio web hecho con

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