Hi everyone,
I have a short question : How to access ids of shown kanban cards?
Do I need to rebuild the search and domain for py use or can I grab them from form view?
def get_sap_no(self):
if self.order_id:
# We search for order_id to get the customers_id
first = self.env['esc.sst'].search([('order_id', '=', self.order_id)], limit=1)
view = self.env.ref('esc_et.esc_ship_spares_kanban_view_filtered')
action = {'type': 'ir.actions.act_window',
'res_model': 'esc.sst',
'view_type': 'kanban',
'view_mode': 'kanban',
'view_id': view.id,
'domain': [('partner', '=', first.partner)],
'target': 'main',
'context': {
'partner' : first.partner,
}
}
return action
edit:
Wenn in JS, I don´t get a value.
_CloseSAPCase: function () {
var self = this;
alert(this.partner)
this._rpc({
model: 'esc.sst',
method: 'write_tch_order',
args: [],
context: {'partner': this.partner,}
}, {
shadow: true,
});
}
I only want to pass the partner number I got in my def get_sap_no to my def write_tch_order to perform some stuff.
Programs way:
wizard button --> def_get_sap --> returns custom kanban view with domain filter -->JS Button to close case --> def write_thc_order
But after the Kanban return my partner is gone :(
Okay, ehhm... nope...
maybe I should have added request for Odoo 15.0.
short :
wizard --> search partner -->open Kanban domain = partner --> do some stuff --> action button for doin stuff (added in JS by Cybros tutorial).
But both, JS and py saying nothing in self.env.context.get or self.partner
long:
I fully understood that each kanban cards is a tuple of the record and I already did a search as you can see in my code.
I have a wizard to enter order_id and search for it to get it´s partner no. I pass this partner to an action to get a filtered kanban view (see above my code, plz) related to my search.
I added a context as I only need to have the partner from there (beacause I can search for related values in model then).
'context': {
'partner' : first.partner,
}
But I wrap my head around to understand why I don´t have a value in self.env.context.get('partner') on my filtered Kanban.