Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Report Customization

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
manufacturingtraceabilityCustomization
2 Risposte
879 Visualizzazioni
Avatar
Vashmitha V

Hello there,


I have added a custom field named "Reference lot/serial" in MO


that field needs to be added to the traceability report,



Add that custom field as a separate column in this report.

How can I add this? Is there any separate model for this?

If there is any idea, kindly let me know. 

Note: Odoo16 e+


Thank you!

-1
Avatar
Abbandona
Avatar
Vashmitha V
Autore Risposta migliore

 NOTE: The "ref_lot_serial_number" field is added in stock_move

models/traceability_report.py

from odoo import models, api

class MrpStockReport(models.TransientModel):
_inherit = 'stock.traceability.report'

def _make_dict_move(self, level, parent_id, move_line, unfoldable=False):

result = super()._make_dict_move(level, parent_id, move_line, unfoldable)

ref_lot_serial = move_line.move_id.ref_lot_serial_number if move_line.move_id.ref_lot_serial_number else ''

print(f"level {level} parent_id {parent_id} move_line {move_line} ref_lot_serial {ref_lot_serial}")

for rec in result:
rec['ref_lot_serial_number'] = ref_lot_serial

print(f"result {result}")
return result

@api.model
def _final_vals_to_lines(self, final_vals, level):

lines = super()._final_vals_to_lines(final_vals, level)

for line in lines:
line['ref_lot_serial_number'] = ''

matching = next((f for f in final_vals if f['model_id'] == line['model_id']), None)
if matching and 'ref_lot_serial_number' in matching:
line['ref_lot_serial_number'] = matching['ref_lot_serial_number']

line['columns'].insert(4,line['ref_lot_serial_number'])

return lines

views/traceability_report.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="inherit_report_stock_inventory" inherit_id="stock.report_stock_inventory">
<xpath expr="//thead/tr[@class='o_report_header']/th[contains(., 'Lot/Serial #')]" position="after">
<th class="o_report_line_header">Ref Lot/Serial</th>
</xpath>
</template>

<template id="inherit_report_stock_body_print" inherit_id="stock.report_stock_body_print">
<xpath expr="//thead/tr[@class='o_report_header']/th[contains(., 'Lot/Serial #')]" position="after">
<th class="o_report_line_header">Ref Lot/Serial</th>
</xpath>
</template>
</odoo>


the result:


0
Avatar
Abbandona
Avatar
D Enterprise
Risposta migliore

Hii,

Here is custom model please try this

Python: Add Custom Field
you will already add

XML: Extend Traceability Report Template

In your custom module (views/report_traceability_line_inherit.xml), use the following code:

<odoo> <!-- Inherit the QWeb template used for the traceability report --> <template id="report_traceability_line_inherit_ref_lot" inherit_id="stock.report_traceability_line"> <!-- Add new column header --> <xpath expr="//thead/tr" position="inside"> <th>Reference Lot/Serial</th> </xpath> <!-- Add new column data --> <xpath expr="//tbody/tr" position="inside"> <td> <t t-esc="line.reference_lot_serial or ''"/> </td> </xpath> </template> </odoo>

__manifest__.py

Ensure the view is loaded in your manifest:


'data': [ 'views/report_traceability_line_inherit.xml', ],

i hope it is usefull

0
Avatar
Abbandona
Vashmitha V
Autore

Hello there,
Thanks for you reply, I customized it yesterday

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
You should provide a lot for the final product
manufacturing traceability
Avatar
0
nov 17
3831
Product with serial numbers have batch number. Should we track batch number with product attributes?
manufacturing attributes traceability
Avatar
0
dic 17
5774
Serial number tracking across multiple MO's/Repairs
manufacturing repair traceability Odoo16
Avatar
0
ott 24
1682
How To list Lot/Serial Number from a specific product?
manufacturing lot serial_number traceability
Avatar
0
giu 17
8873
How to make Odoo schedule manufacturing in parallel?
manufacturing
Avatar
0
ott 25
493
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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