Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to send a field value from purchase order to stock and invoice?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
v6.1purchase_order
2 Respostes
10261 Vistes
Avatar
luis

I successfully added 3 custom fields in Purchase order. now how can i send the values to stock picking and finally invoice.

0
Avatar
Descartar
Avatar
Ray Carnes
Best Answer

You can only do this through a module - python code that defines the three custom fields on sale.order, stock.picking and account.invoice.

Have a look at http://v6apps.openerp.com/addon/6739

1) It adds a new custom field address_shipping_id to account.invoice

2) It overrides the _make_invoice function in sale.order to populate the shipping address by copying it over from the Sales Order.

0
Avatar
Descartar
Avatar
luis
Autor Best Answer

Hi, Ray thanks for your answer. I followed your advice I think I understand in part. I generate this code but send me an error, maybe you can help me with this:

class account_invoice(osv.osv):

_inherit = 'account.invoice'
_name = 'account.invoice'


_columns = {
        'origen_pos_id': fields.many2one('pos.order', 'Relación Ticket', required=False),
        'origen_invoice_id': fields.many2one('account.invoice', 'Relación Factura', required=False),
        }

account_invoice()

class purchase_order(osv.osv):

_inherit = 'purchase.order'
#_name = 'purchase.order'


_columns = {
        'ref_oc': fields.char('Referencia OC', size=64, readonly=False),
        'ref_pos_id': fields.many2one('pos.order', 'Relación Ticket', required=False),
        'ref_invoice_id': fields.many2one('account.invoice', 'Relación Factura', required=False),
        }


def action_invoice_create(self, cr, uid, ids, context=None):
    """
    Extended
    """
    #  create invoice
    invoice_id = super(purchase_order, self).action_invoice_create(cr, uid, ids, context=context)

    # check

    vals = {}
    for order in self.brows(cr, uid, ids):
      if order.ref_pos_id:
        vals['origin_pos_id'] = order.ref_pos_id.id
      if order.ref_invoice_id:  
        vals['origin_invoice_id'] = order.ref_invoice_id.id

        if vals:
            # write to invoice
            self.pool.get('account.invoice').write(cr,uid, [invoice_id], vals)
            return invoice_id

purchase_order()

Error:

File "/home/openerp/addons_linked/ref_oc/ref_oc.py", line 69, in action_invoice_create for order in self.brows(cr, uid, ids): AttributeError: 'purchase.order' object has no attribute 'brows'

0
Avatar
Descartar
Ray Carnes

This error indicates you have self.brows instead of self.browsE but I don't see this above - what is line 69 of rec_oc.py ?

luis
Autor

line 69 --> for order in self.brows(cr, uid, ids):

Ray Carnes

As I posted already, It should be --> for order in self.browse(cr, uid, ids): --- you are not spelling browse correctly.

luis
Autor

You was right. thanks Ray.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
눈Volaris Contacto Numero눈¿Cómo hablar con un asesor de Volaris?
v6.1
Avatar
0
de nov. 25
10
importing Purchase Order shown as a RFQ Solved
purchase_order
Avatar
Avatar
Avatar
2
de maig 25
3067
Create a PO without adding products to stock
purchase_order
Avatar
Avatar
Avatar
Avatar
3
de des. 24
9055
How do I replace the default Purchase Order number? Solved
purchase_order
Avatar
Avatar
1
de jul. 24
4621
Manufacturing to delivery, how are scheduled MRP operations?
v6.1
Avatar
1
de juny 24
4208
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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