Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

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

Naroči se

Get notified when there's activity on this post

This question has been flagged
sequencesodoo9
4 Odgovori
7504 Prikazi
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
Opusti
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
Opusti
Alfa y Omega Pachuca
Avtor

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
Avtor

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
Avtor

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
Avtor

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

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
How to get data n view using custom widget in odoo 9
odoo9
Avatar
0
sep. 23
2837
How to get data n view using custom widget in odoo 9
odoo9
Avatar
0
sep. 23
2531
sequence prefix. Solved
sequences
Avatar
Avatar
Avatar
3
sep. 23
5160
How to Remove " ADD NEW COLUMN " from task kanban view of Project Module? Solved
odoo9
Avatar
Avatar
Avatar
2
jun. 25
12174
How to edit the product website description Solved
odoo9
Avatar
Avatar
Avatar
Avatar
Avatar
6
okt. 23
23490
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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