I have created a model:
from odoo import models, fields, api
class ArticleNumber(models.Model):
_name = "article.number"
_description = "Article Number"
name = fields.Char('Name', index=True, required=True, translate=True)
article_number = fields.Char()
product_id = fields.Many2one('product.product', string="Product")
date = fields.Date()
Now when I load that in, inside the sale.order.line with this:
from odoo import models, fields, api
class SaleOrder(models.Model):
_inherit = "sale.order"
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
article_id = fields.Many2one('article.number', 'Article Number', change_default=True, ondelete='restrict')
and here in the view:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="sale_order_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='name']" position="after">
<field name="article_id"/>
</xpath>
</field>
</record>
</data>
</odoo>
I get this back:
I only want the Name there, not the object,id
What is wrong here?