Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Add a note/ Add a section in mrp.porduction

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
mrpsale.order.lineadd a sectionadd a note
2 Răspunsuri
1140 Vizualizări
Imagine profil
Guhan Dhamodiraswamy

hi i wanted to add the Add a note / Add a section in the mrp.production lines same as  the  sale.order 


Any help would be appreciated.  Thanks!


 

0
Imagine profil
Abandonează
Ard van Someren

Have you tried to create a server action to add a record?

Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

Hi,

Please refer to the following links:

1. https://www.cybrosys.com/blog/how-to-add-a-section-and-note-for-a-custom-module-in-odoo-18

2. https://www.cybrosys.com/blog/how-to-add-a-section-and-note-for-a-custom-module-in-odoo-17


Hope it helps.

0
Imagine profil
Abandonează
Imagine profil
Jesing Rathod
Cel mai bun răspuns

Hello Guhan Dhamodiraswamy,




Try the following code.


1. Inherit mrp.production and line model:



from odoo import models, fields




class MrpProductionLine(models.Model):


    _inherit = 'mrp.production.line'




    display_type = fields.Selection([


        ('line_section', "Section"),


        ('line_note', "Note"),


    ], default=False)


2. Inherit XML view and added the fields

<!-- views/mrp_production_view.xml -->




<odoo>


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


    <field name="name">mrp.production.form.inherit.sections</field>


    <field name="model">mrp.production</field>


    <field name="inherit_id" ref="mrp.mrp_production_form_view"/>


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


      <xpath expr="//field[@name='move_raw_ids']" position="attributes">


        <attribute name="context">{'default_display_type': False}</attribute>


      </xpath>




      <xpath expr="//field[@name='move_raw_ids']/tree" position="before">


        <header>


          <button name="add_section" string="Add a section" type="object" class="oe_highlight"/>


          <button name="add_note" string="Add a note" type="object"/>


        </header>


      </xpath>




      <xpath expr="//field[@name='move_raw_ids']/tree/field[@name='product_id']" position="before">


        <field name="display_type" invisible="1"/>


      </xpath>




      <xpath expr="//field[@name='move_raw_ids']/tree" position="attributes">


        <attribute name="decoration-muted">display_type != False</attribute>


      </xpath>


    </field>


  </record>


</odoo>



3. Add add_section and add_note Methods in the mrp.production:


def add_section(self):


        for order in self:


            order.move_raw_ids += self.env['mrp.production.line'].new({


                'display_type': 'line_section',


                'name': 'New Section',


            })




    def add_note(self):


        for order in self:


            order.move_raw_ids += self.env['mrp.production.line'].new({


                'display_type': 'line_note',


                'name': 'New Note',


            })



0
Imagine profil
Abandonează
Guhan Dhamodiraswamy
Autor

Hi,
Thanks for the reply.
i am using odoo18 and there is no model called mrp.production.line

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
filter on many2many fields
stock mrp sale.order.line
Imagine profil
Imagine profil
1
mar. 15
16631
¿Cómo puedo recorrer un campo one2many y sumar la cantidad de productos que tienen el mismo id en odoo versión 15?
mrp sale.order.line odoo.sh v15
Imagine profil
Imagine profil
1
oct. 23
3320
Forcing MO Creation regardless of product.product qty
mrp sale.order.line sale.order v15 MTO
Imagine profil
Imagine profil
1
aug. 23
2871
BOM in Sale Order lines Rezolvat
python mrp sale.order.line bom v12
Imagine profil
1
sept. 20
5016
Sale to SaleOrderLine with 'Make to Order' was checked in ProductTemplate
sales mrp sale.order.line production odooV12
Imagine profil
Imagine profil
4
nov. 19
2887
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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