Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Cervecería
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y soporte técnico
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Explorar todos los sectores
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Servicios para partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar 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
  • Proyecto
  • 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 to change invoice sequence number ?

Suscribirse

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

Se marcó esta pregunta
invoicesequencenumberir.sequence
2 Respuestas
25002 Vistas
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
Descartar
Avatar
Ankit H Gandhi(AHG)
Autor Mejor respuesta

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

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

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Open and create an existing invoice due to Sequence
invoice sequencenumber
Avatar
0
sept 20
3295
Sequence invoice number on billing date
invoice sequencenumber
Avatar
0
sept 18
3944
[9.0] How to generate an invoice number including the id_client ? (CLI/2016/XX) Resuelto
invoice sequencenumber
Avatar
Avatar
1
feb 17
4094
Invoincing Sequence (Maybe Hungary specific) Resuelto
invoice sequencenumber Hungary
Avatar
1
feb 24
1839
How to correct wrong invoice sequence?
invoice sequence sequencenumber
Avatar
Avatar
3
jul 23
6183
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 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