hi, i have creating a custom field in odoo and want to set a value as it get from partner id field below is the function iam using to get the value help me in this regard
model code
from odoo import models,fields,api
class SaleOrderInherited(models.Model):
_inherit = 'sale.order'
#custom_field = fields.Char(string='Custom Field')
def _get_default_access_token(self):
#return str(uuid.uuid4())
return "testing"
#custom_field = fields.Char(string='Custom Field',default)
custom_field=fields.Text(string="Registration Note",default=_get_default_access_token)
view code
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="sales_view_form" model="ir.ui.view">
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="date_order" position="after">
<!--<field name="custom_field"/>-->
</field>
</field>
</record>
</data>
</odoo>