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
    • eLearning
    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
    • Información
    • 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 taberna
    • 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
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • 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
    Browse all Industries
  • 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
    • Services for 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

Add custom fields to sales order

Suscribirse

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

Se marcó esta pregunta
salesorder
7 Respuestas
69524 Vistas
Avatar
Jhon Felipe Urrego Mejia

Hi, please give me instructions or share me a little documentation for add custom fields to sales order, tnks

5
Avatar
Descartar
Quang Huynh

Hi All,

   I want to add custom field named "Test" into BoM & Structure report also, please help to share

   The "Test" field was inputed line by line with bom line

Thanks,

Avatar
Shameem Babu
Mejor respuesta

In Odoo 10,

Python file
from odoo import models, fields

class SaleOrderInherited(models.Model):
_inherit = 'sale.order'

custom_field = fields.Char(string='Custom Field')
Xml file
<!--Inherit the sale order form view--> 
<record id="view_sale_order_custom" model="ir.ui.view">
<field name="name">sale.order.custom.form.inherited</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="custom_field"/>
  </xpath>
</field>
</record>
Watch this on YouTube : Additional field to existing view in odoo 10

All the best !

3
Avatar
Descartar
Avatar
Alfa y Omega Pachuca
Mejor respuesta

In odoo 9 (in you have you odoo server in other directory, just change the path to you odoo directory installation)

Create a new custom module:

cd /odoo/odoo-server <--Here inside is the odoo.py script to create a new custom module.

sudo ./odoo.py scaffold myfieldsinsaleorder /odoo/custom/addons <--This is my directory for my custom modules, this code create a new custom module

cd /odoo/custom/addons/myfieldsinsaleorder

Edit __openerp__.py and save this settings:

locate: 'depends': ['base'], and add 'sale' and 'product' like this:

'depends': ['base','sale','product'],

Edit models.py and save this settings: <-- here you can add your custom fields

from openerp import models, fields, api

class myfieldsinsaleorder(models.Model):

_inherit = 'sale.order'

mycustomfield1 = fields.Char('My custom field 1 Label', default = 'My custom field 1 default value')

Edit templates.xml and save this settings: <-- here you can add the custom field to sale order form and print to sale order quotation document

 <openerp>

<data>

<record id="my_view_saleorder_form_inherit" model="ir.ui.view">

<field name="name">my.view.saleorder.form.inherit</field>

<field name="model">sale.order</field>

<field name="inherit_id" ref="sale.view_order_form"/>

<field name="arch" type="xml">

<!-- Locate the position to add a new tab "My New Tab" in "Form View Sale Order"-->

<xpath expr="//page[1]" position="after">

<page string="My New Tab">

<group>

<!-- here we add our new field "mycustomfield1" inside our new tab -->

<field name="mycustomfield1"/>

</group>

</page>

</xpath>

</field>

</record>

<!-- This is to add our field in the quotation saler order and print -->

<template id="my_report_saleorder_document" inherit_id="sale.report_saleorder_document">

<xpath expr="//table[@class='table table-condensed']" position="after">

<strong>My label field for quotation sale order: </strong><span t-field="doc.mycustomfield1"/><br></br>

<!-- with this code we can add fields from other module (products) to sale order document and print -->

<strong>Field get it from product module: </strong><span t-field="doc.product_id.product_tmpl_id.warranty"/>

</xpath>

</template>

 </data>

</openerp>


5
Avatar
Descartar
Avatar
Nehal
Mejor respuesta

HI,

You can create custom field in Sale order by creating a module or from GUI.

From GUI, you can add the custom field using menu: Settings > Technical > Database Structure > Fields (Make sure the user has 'Technical Features' enabled in their access rights) To make them show up on the UI itself you will then need to add them to a view (Settings > Technical > User Interface > Views).

2
Avatar
Descartar
Jhon Felipe Urrego Mejia
Autor

I need create with new module, i don't want after update lose everything

Avatar
Bart Criel
Mejor respuesta

Hi,

You need to create 2 files: a xml- and a py-file. The example below shows how to add a field 'MRSP' to the product form.

Content of the py-file

class product_product(osv.osv):
    _inherit = "product.product"

    _columns = {
                'mrsp': fields.float('MRSP', digits_compute=dp.get_precision('Product Price'),
                                    help="The Manufacturer Recommended Sales Price."),
    }

product_product()

Example content of the xml-file (this depends heavily on where and how you want to put the field, so I can't be more specific; use existing xml files as inspiration)

<record id="product_mrsp_form_view" model="ir.ui.view">
    <field name="name">product.normal.form</field>
    <field name="model">product.product</field>
    <field name="inherit_id" ref="product.product_normal_form_view"/>
    <field eval="7" name="priority"/>
    <field name="arch" type="xml">
               <field name="mrsp" attrs="{'invisible': [('sale_ok', '!=', True)]}"/>
    </field>
</record>

You of course need to add these files in __init__ and __openerp__

Bart

1
Avatar
Descartar
Jhon Felipe Urrego Mejia
Autor

hI, how can i create other flange in sales order?

Bart Criel

What do you mean with "flange"?

Jhon Felipe Urrego Mejia
Autor

https://dl.dropboxusercontent.com/u/75366808/flange.png

Jhon Felipe Urrego Mejia
Autor

Hi please give me some support i need add 5 columns to sales order line, tnks

Bart Criel

This topic http://help.openerp.com/question/16336/how-i-can-create-module-openerp-7/ is full of interesting and relevant information. Use a simple existing module (e.g. sale_margin) as example or inspiration.

Avatar
Muhammad Saeed Sher Khan
Mejor respuesta

It is Better If You Use Odoo Studio for Customisation. 

0
Avatar
Descartar
Avatar
Jhon Felipe Urrego Mejia
Autor Mejor respuesta

I need create with new module, i don't want after update lose everything

0
Avatar
Descartar
Nehal

You may refer the following link for developing custom module: http://www.pixelite.co.nz/article/adding-additional-fields-using-custom-module-openerp-7

Avatar
Mayur Maheshwari
Mejor respuesta

Hi ,

tutorial link : http://maheshwarimayur.blogspot.in/2013/02/how-to-add-new-field-on-any-object-in.html

Hope it helps you more !

0
Avatar
Descartar
Jhon Felipe Urrego Mejia
Autor

But .it's batter you add custom field in xml with use of view inheritance.

¿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
What is the meaning of Locked SOs vs "Not Locked" Resuelto
sales order
Avatar
Avatar
1
feb 22
5143
how can I apply Cash on delovery payment in e-commerce ? Resuelto
sales order
Avatar
Avatar
2
mar 24
3758
user have access to sales own leads when selecting customer shows an errorr Access Denied The requested operation cannot be com
sales order
Avatar
0
mar 15
4097
admin created a new user user1 and access rights to sales,the user1 selects product in sales form shows an error Access Denied T
sales order
Avatar
0
mar 15
4069
Adding new field to Orders
sales order
Avatar
Avatar
1
mar 15
4411
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