Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

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

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

Add custom fields to sales order

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
salesorder
7 Respostas
69535 Visualizações
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
Cancelar
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
Melhor resposta

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
Cancelar
Avatar
Alfa y Omega Pachuca
Melhor resposta

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
Cancelar
Avatar
Nehal
Melhor resposta

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
Cancelar
Jhon Felipe Urrego Mejia
Autor

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

Avatar
Bart Criel
Melhor resposta

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
Cancelar
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
Melhor resposta

It is Better If You Use Odoo Studio for Customisation. 

0
Avatar
Cancelar
Avatar
Jhon Felipe Urrego Mejia
Autor Melhor resposta

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

0
Avatar
Cancelar
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
Melhor resposta

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
Cancelar
Jhon Felipe Urrego Mejia
Autor

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

Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Publicações relacionadas Respostas Visualizações Atividade
What is the meaning of Locked SOs vs "Not Locked" Resolvido
sales order
Avatar
Avatar
1
fev. 22
5150
how can I apply Cash on delovery payment in e-commerce ? Resolvido
sales order
Avatar
Avatar
2
mar. 24
3771
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
4113
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
4080
Adding new field to Orders
sales order
Avatar
Avatar
1
mar. 15
4421
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة 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 é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

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