Hi all,
I'm trying show a partners in dropdown box at Warehouse->All operations->Click to launch the barcode interface.
my code is:
in addons\stock\static\src\xml\picking.xml
<div class="col-md-3 col-sm-4 col-xs-6">
<h3><strong>
<select class="form-control">
<t t-foreach="widget.get_partners()" t-as="partner">
<option value="partne.id"><t t-esc="partner.name"/></option>
</t>
</select>
</strong>
</h3>
</div>
in \addons\stock\static\src\js\widget.js
get_partners: function(){
var self = this;
var partners = [];
var model = new instance.web.Model('res.partner');
model.query(['id', 'name']).filter([['customer', '=', 'True']]).limit(1000).all().done(function(partners){
self.partners = partners;
console.log(partners); // returns excepted values
});
return partners; // but here doesn't return any value
},
I mentioned in my code by comments, what i need.
please give me suggestions.
Thanks in advance
jyothimani,
at place of "return partners", try "return self.partners"...
I tried it. but not returns any value.