Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

How to change invoice sequence number ?

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
invoicesequencenumberir.sequence
2 Risposte
25006 Visualizzazioni
Avatar
Ankit H Gandhi(AHG)

Hello All,

I want to change invoice sequence number like Inv/assessment year(AY)/Monthname/0001

For Example Inv/19-20/July/0001

I have follow below step to achive this things

Setting-->Technical-->Sequences&identifiers-->Sequence and search invoice.

Modified prefix as Inv/%(year)s/%(month)s/ and I got the new invoice number as Inv/2019/07/0001 but I want to invoice number as Inv/19-20/July/0001

Thanks in advance

Ankit H Gandhi

2
Avatar
Abbandona
Avatar
Ankit H Gandhi(AHG)
Autore Risposta migliore

Hello All,

I found this solution using re-define method of _get_prefix_suffix

def _get_prefix_suffix(self):
def _interpolate(s, d):
return (s % d) if s else ''

def _interpolation_dict():
now = range_date = effective_date = datetime.now(pytz.timezone(self._context.get('tz') or 'UTC'))
if self._context.get('ir_sequence_date'):
effective_date = fields.Datetime.from_string(self._context.get('ir_sequence_date'))
if self._context.get('ir_sequence_date_range'):
range_date = fields.Datetime.from_string(self._context.get('ir_sequence_date_range'))

sequences = {
'year': '%Y', 'month': '%m', 'day': '%d', 'y': '%y', 'doy': '%j', 'woy': '%W',
'weekday': '%w', 'h24': '%H', 'h12': '%I', 'min': '%M', 'sec': '%S'
}
if range_date:
ay = str(range_date.year)[2:] + '-' + \
str(range_date.year + 1)[2:]
sequences.update({'ay': ay, 'month_text': '%B'})
res = {}
for key, format in sequences.items():
res[key] = effective_date.strftime(format)
res['range_' + key] = range_date.strftime(format)
res['current_' + key] = now.strftime(format)

return res

d = _interpolation_dict()
try:
interpolated_prefix = _interpolate(self.prefix, d)
interpolated_suffix = _interpolate(self.suffix, d)
except ValueError:
raise UserError(_('Invalid prefix or suffix for sequence \'%s\'') % (self.get('name')))
return interpolated_prefix, interpolated_suffix
Then Go to 
Setting-->Technical-->Sequences&identifiers-->Sequence and search invoice.

Change Prefix to: Inv/%(ay)s/%(month_text)s/

Appreciate to Mitul Shingala and OdooTools

Best Regards,

Ankit H Gandhi.

​

3
Avatar
Abbandona
Mitul Shingala

Thanks

Sanjit Arun

I am using Odoo 13 and I would like to use this code to implement the fiscal year range into my invoice. Could you guide me how to locate the ir.sequence model and the adjusting the code to reflect the changes in the invoice.

Avatar
faOtools
Risposta migliore

Available suffixes' and prefixes' legends are available right on the sequence form:

  • Current Year with Century: %(year)s

  • Current Year without Century: %(y)s (in your case '19', centure alone is not available) 

  • Month: %(month)s (only number, textual representation is not available)

  • Day: %(day)s

  • Day of the Year: %(doy)s

  • Week of the Year: %(woy)s

  • Day of the Week (0:Monday): %(weekday)s

  • Hour 00->24: %(h24)s

  • Hour 00->12: %(h12)s

  • Minute: %(min)s

  • Second: %(sec)s

As you can see those standard legends can not help to achieve your goals.

You should add a bit of coding to re-define the method '_get_prefix_suffix' of the model ir.sequence (the module 'base') by adding extra legends expressions.


5
Avatar
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
Open and create an existing invoice due to Sequence
invoice sequencenumber
Avatar
0
set 20
3296
Sequence invoice number on billing date
invoice sequencenumber
Avatar
0
set 18
3944
[9.0] How to generate an invoice number including the id_client ? (CLI/2016/XX) Risolto
invoice sequencenumber
Avatar
Avatar
1
feb 17
4094
Invoincing Sequence (Maybe Hungary specific) Risolto
invoice sequencenumber Hungary
Avatar
1
feb 24
1841
How to correct wrong invoice sequence?
invoice sequence sequencenumber
Avatar
Avatar
3
lug 23
6183
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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