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

Sales Quotation sequence number: three different sequence number in sales quotation for three different companies(multi company)

Suscribirse

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

Se marcó esta pregunta
quotationmulticompanysequencenumber
3 Respuestas
6535 Vistas
Avatar
Remya

I need to configure the sequence number for my sales quotation. And also I have three companies. I want 

Company1 - AAN01

Company2 - ABM01

Company3 - AZX01

What is the python code for the above requirement?

   @api.model
    def create(self,vals):
            if vals.get('sequence_name', _('New')) == _('New'):
                vals['sequence_name'] = self.env['ir.sequence'].next_by_code('sale.order') or _('New')
            res = super(sale_order, self).create(vals)
            return res


<record id="seq_sale_order" model="ir.sequence">
<field name="name">Sales Order</field>
<field name="code">sale.orders</field>
<field name="prefix">AAN</field>
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>



0
Avatar
Descartar
Avatar
Ricardo Gross
Mejor respuesta

Hi Remya,

You can just go to: Settings / Technical / Sequences & Identifiers / Sequences / sale.order , and you can create separate sequences for each company (duplicate existing sequence and create one for each company).

See also the answer from:  https://www.odoo.com/forum/help-1/question/configuration-on-odoo-v-13-multi-company-setup-158830#answer-158840

BR

Ricardo




1
Avatar
Descartar
Remya
Autor

That's ok. But I need to implement it through my customized code. Plz guide me to correct the below code

Avatar
Mohammed Rida Yahla
Mejor respuesta

Hi bro,

To do that you need first to create 3 sequences and define their names and prefix.

Then add this code in your class : 

@api.model
def create(self,vals):
	if self.company_id and vals.get('name', '/') == '/':
		if self.company_id.name =="YourFirstCompanyName":#Company1 
			seq_id = self.pool.get('ir.model.data').get_object_reference(self._cr,self._uid,'sale_order', 'YourCompany1SequenceID')[1]
			self.name = self.pool.get('ir.sequence').get_id(self._cr,self._uid , seq_id, 'id',self._context)

if self.company_id.name =="YourSecondCompanyName":#Company2 seq_id = self.pool.get('ir.model.data').get_object_reference(self._cr,self._uid,'sale_order', 'YourCompany2SequenceID')[1] self.name = self.pool.get('ir.sequence').get_id(self._cr,self._uid , seq_id, 'id',self._context)
if self.company_id.name =="YourThirdCompanyName":#Company3 seq_id = self.pool.get('ir.model.data').get_object_reference(self._cr,self._uid,'sale_order', 'YourCompany3SequenceID')[1] self.name = self.pool.get('ir.sequence').get_id(self._cr,self._uid , seq_id, 'id',self._context) return super(sale_order, self).create(vals)
YourCompany3SequenceID = xml ID of the  sequence for the third company. 

Dont forget to vote positif :)


1
Avatar
Descartar
Remya
Autor

Very thankful for your answer. YourCompany3SequenceID = seq_sale_order

{. <record id="seq_sale_order" model="ir.sequence">}. Right???

Remya
Autor

Yet I didn't get any solution

Mohammed Rida Yahla

brther you have tocreate 2 more other sequences , the standard one is what you mentionned, you can use it as sequence for the first company , but you need to create 2 more sequences one for the second company and one for the third.

and it's a tested solution :) it works i promise

Remya
Autor

Hi, I had created 3 sequences for my three different company and mentioned as the above code. But it is not creating a sequence code.

But I will try to solve the issue in my code. Thanks for your reply

¿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
Multiple lines in the quotation calculator
quotation
Avatar
0
nov 25
1155
Clarification on Creating Companies and Users in the Odoo Database
multicompany
Avatar
Avatar
Avatar
2
jul 25
2952
Multi Company set up
multicompany
Avatar
Avatar
Avatar
3
jul 25
3450
How many levels of sub-entities does the multicompany functionality of the accounting software support? Resuelto
multicompany
Avatar
Avatar
1
jul 25
2547
Design Quotation Template with dynamic variables
quotation
Avatar
0
abr 25
3440
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