Hi all, I'm new to Odoo and tried to produce my first module…
It is -sort of- working but not completely !
My problem is that I create a new field "iban_qr_number" but I need to turn "developer mode" to see my field.
I declared my field like this:
from odoo import models, fields
class ResCompany(models.Model):
_inherit = 'res.company'
iban_qr_number = fields.Many2one('res.partner.bank', domain="[('partner_id','=', partner_id)]",)
and create extend res_company_form:
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="res_company_form" model="ir.ui.view">
<field name="name">res.company.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='currency_id']" position="after">
<field name="iban_qr_number" string="IBAN QR Code on Invoice" placeholder="FR7630004000031234567890143" groups="base.group_no_one"/>
</xpath>
</field>
</record>
</odoo>
I added groups="base.group_no_one" because otherwise I hit an error saying that partner_id is only available for base.group_no_one
Obviously it is not what I want, I'd like to have the same access rights as res_company_form, if user can edit it, he can edit iban_qr_number.
Thank you for your help