Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
333 Vizualizări

Hello,

I need to enable the Sales Order Lines modal (form popup Open: Order Lines) from the Sales Order form view in Odoo 18.

However, I only have the ability to modify the sale.order.form view.

What exactly should I change in the view to allow opening the Order Lines modal directly from the Sales Order form?

I would appreciate any guidance or solution.

Thank you!

Imagine profil
Abandonează
Autor

Thank you!

Cel mai bun răspuns

Remove 

editable="bottom"

from the list-element. Doing so will result in 

... upon clicking on a existing Sale Order Line and or when adding a new one.


Note: Instead of directly modifying the view, strongly consider creating a view inherit in a custom module and use an attribute node to change the default behavior, i.e.

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="view_order_form_inherit" model="ir.ui.view">
        <field name="name">sale.order.form.inherit</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
            <xpath expr="//page[@name='order_lines']/field[@name='order_line']/list" position="attributes">
                <attribute name="editable"/> <!-- to unset the original value of 'bottom' -->
            </xpath>
        </field>
    </record>
</odoo>

See also: https://www.odoo.com/documentation/18.0/administration/odoo_sh/getting_started/first_module.html or https://www.odoo.com/documentation/18.0/developer/tutorials/backend.html and https://www.odoo.com/documentation/18.0/developer/reference/user_interface/view_records.html

Imagine profil
Abandonează