i have custom object "order.tracking" and i want to when user import data to my module it will update order details in sale order. i added menu and page in sale module.
look at my py file:
class order_tracking_import(models.Model):
_name = 'order.tracking'
name = fields.Char(string='Order')
draft = fields.Datetime(string='Draft Date')
process_datetime = fields.Datetime(string='Process Date')
packed_datetime = fields.Datetime(string='Packed Date')
shipped_datetime = fields.Datetime(string='Shipped Date')
delivered_datetime = fields.Datetime(string='Delivered Date')
paid_datetime = fields.Datetime(string='Paid Date')
paid = fields.Selection(([('f','Fully'),('p','Partially')]),string='Paid',default='f')
class evo_akasha_order_tracking(models.Model):
_inherit = 'sale.order'
date_id = fields.Many2one('order.tracking')
draft_datetime = fields.Datetime(string='Draft Date', readonly=True)
process_datetime = fields.Datetime(string='Process Date', readonly=True)
packed_datetime = fields.Datetime(string='Packed Date', readonly=True)
shipped_datetime = fields.Datetime(string='Shipped Date', readonly=True)
delivered_datetime = fields.Datetime(string='Delivered Date', readonly=True)
paid_datetime = fields.Datetime(string='Paid Date', readonly=True)
paid = fields.Selection(([('f','Fully'),('p','Partially')]),string='Paid',default='f')
and my xml:
<odoo>
<record model="ir.ui.view" id="evo_akasha_order_tracking.form">
<field name="name">akasha_order_tracking form</field>
<field name="model">sale.order</field>
<field name='inherit_id' ref='sale.view_order_form'/>
<field name="arch" type="xml">
<xpath expr='//notebook' position='inside'>
<page string='Order Tracking'>
<group string='Order Tracking Information'>
<field name='draft_datetime'/>
<field name='process_datetime'/>
<field name='packed_datetime'/>
<field name='shipped_datetime'/>
<field name='delivered_datetime'/>
<field name='paid_datetime'/>
<field name='paid' widget='selection'/>
</group>
</page>
</xpath>
</field>
</record>
<record id="action_orders_tracking" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form,pivot,graph,calendar</field>
</record>
<menuitem name="All Orders" id="evo_akasha_order_tracking.menu"
parent="sale.sale_order_menu" action='action_orders_tracking' sequence='0'/>
<record model="ir.ui.view" id="sale_order_tracking_tree">
<field name="name">sale_order_tracking_tree</field>
<field name="model">order.tracking</field>
<field name="arch" type="xml">
<tree string='Order Tracking Status'>
<field name='name'/>
<field name='draft'/>
<field name='process_datetime'/>
<field name='packed_datetime'/>
<field name='shipped_datetime'/>
<field name='delivered_datetime'/>
<field name='paid_datetime'/>
<field name='paid' widget='selection'/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="sale_order_tracking_form">
<field name="name">sale_order_tracking_form</field>
<field name="model">order.tracking</field>
<field name="arch" type="xml">
<form string='Order Tracking Status'>
<sheet>
<group string='Order Tracking Status'>
<field name='name'/>
<field name='draft'/>
<field name='process_datetime'/>
<field name='packed_datetime'/>
<field name='shipped_datetime'/>
<field name='delivered_datetime'/>
<field name='paid_datetime'/>
<field name='paid' widget='selection'/>
</group>
</sheet>
</form>
</field>
</record>
<record id="action_orders_tracking_status" model="ir.actions.act_window">
<field name="name">Tracking Order Status</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">order.tracking</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Import Order Tracking Status" id="evo_akasha_order_import"
parent="sale.menu_sale_config" action='action_orders_tracking_status' sequence="-1"/>
</odoo>
i want to when user import data in order tracking it should update in sale module according there sale order sequence. like i put SO006 then it should go only for this order and update it
THANK YOU VERY MUCH