Hello i have a question how to set automatically value field nomor_faktur_po on purchase.order when i set value field nomor_faktur_sp on stock.picking with onchange?
class stock_nomor_faktur(models.Model):
_inherit = 'stock.picking'
nomor_faktur_sp = fields.Char(string='Nomor Faktur')
class stock_nomor_faktur(models.Model):
_inherit = 'purchase.order'
nomor_faktur_po = fields.Char(string='Nomor Faktur')
My stock.picking view
<record id="nomor_faktur_stock_picking" model="ir.ui.view">
<field name="name">nomor_faktur_stock_picking</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='origin']" position="after">
<field name="nomor_faktur_sp"/>
</xpath>
</field>
</record>
My purchase.order View
<record id="nomor_faktur_purchase_order" model="ir.ui.view">
<field name="name">nomor_faktur_purchase_order</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='location_dest_id']" position="after">
<field name="nomor_faktur_po"/>
</xpath>
</field>
</record>