Hi, there,
the following for your reference:
1. modify the .py file to add one function.
def preview_inventory(self):
return {
'name': _('Inventory Lookup'),
'domain': [('po', 'like', self.po), ('partner_id', '=', self.partner_id.id), ('company_id', '=', self.company_id.id), ('state', '=', 'done'), ('picking_type_id', '=', 7)],
'view_type': 'form',
'res_model': 'stock.picking',
'view_id': False,
'view_mode': 'tree',
'type': 'ir.actions.act_window',
'target': 'current',
'context': "{'toolbar':False,'submenu': False,'create': False,'edit': False,'delete': False}"
}
2. modify the. XML file to add one button in right place.
expr="//div/button[@name='preview_sale_order']" position="before">
Replace the element with your own.
I hope it is useful.
thanks.