Home > Back-end >  Odoo Addon View for Sales custom dropdowns not showing properly
Odoo Addon View for Sales custom dropdowns not showing properly

Time:12-11

We are trying Odoo Repo on Ubuntu, we wanna make some custom addons. We read the documentation and we achieved to create some models and views.

The main issue is that drop-down "many2one" fields show at first hiding. The only way to make it work its to click on the area of the form.

We don't know if we are missing something, the JS console does not show any error.

enter image description here

Our view:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_sale_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="//notebook" position="inside">
                <page name="info_cdfi" string="CFDI">
                    <group cols="4">
                        <group string="Detalles de Pago">
                            <field name="forma_pago_id"/>
                            <field name="metodo_pago_id"/>
                            <field name="uso_cfdi_id"/>
                        </group>
                    </group>
                </page>
            </xpath>
        </field>
    </record>
</odoo>

Model:

class SaleOrder(models.Model):
    _inherit = 'sale.order'

    forma_pago_id  = fields.Many2one('cfdi.forma', string='Forma de pago')
    metodo_pago_id = fields.Many2one('cfdi.metodo', string='Metodo de pago')
    uso_cfdi_id    = fields.Many2one('cfdi.uso', string='Uso CFDI (cliente)')

CodePudding user response:

This is normal in Odoo 15.0, You need to click on Edit button or click on the label of the field to be able to edit the value of the filed.

In older versions before 15.0 you have to click on Edit button to be able to edit the value of the filed.

This has been changed in Odoo 16, the Edit button has been removed and you can edit the field directly.

  • Related