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

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

Subscriure's

Get notified when there's activity on this post

This question has been flagged
sequencesodoo9
4 Respostes
7503 Vistes
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
Best Answer

@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 Best Answer

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
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 get data n view using custom widget in odoo 9
odoo9
Avatar
0
de set. 23
2834
How to get data n view using custom widget in odoo 9
odoo9
Avatar
0
de set. 23
2529
sequence prefix. Solved
sequences
Avatar
Avatar
Avatar
3
de set. 23
5160
How to Remove " ADD NEW COLUMN " from task kanban view of Project Module? Solved
odoo9
Avatar
Avatar
Avatar
2
de juny 25
12173
How to edit the product website description Solved
odoo9
Avatar
Avatar
Avatar
Avatar
Avatar
6
d’oct. 23
23489
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