odoo:dev
Table des matières
Odoo dev
Faire un addon
Faire la commande
odoo scaffold makeitsimple_location
pour créer la structure d'une app Généralement dans le dossier: /usr/lib/python3/dist-packages/odoo/addons
Type de champs
fields.Selection([ ('type1', 'Type 1'),('type2', 'Type 2'),],'Type', default='type1')
Hériter un modèle
En modèle
class ProductTemplate(models.Model): _inherit = 'product.template' _order = 'name' rental_ok = fields.Integer("Allow rental")
En vue
<record id="product_template_common_form_inherited" model="ir.ui.view"> <field name="name">product.template.common.form.inherited</field> <field name="model">product.template</field> <field name="inherit_id" ref="product.product_template_form_view"/> <field name="arch" type="xml"> <xpath expr="//div[@name='options']" position="after"> <!-- <span class="d-inline-block">--> <field name="rental_ok" widget="toggle"/> <!-- <l </span>--> </xpath> </field> </record>
odoo/dev.txt · Dernière modification : de root
