Skip to content

Commit

Permalink
Merge e9f10e6 into fc23c0d
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoBM committed Nov 23, 2019
2 parents fc23c0d + e9f10e6 commit c38ece3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sale_commission/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ def fields_view_get(self, view_id=None, view_type='form', toolbar=False,
if view_type == 'form':
doc = etree.XML(res['arch'])
for node in doc.xpath("//field[@name='order_line']"):
node_val = node.get('context', '{}').strip()[1:-1]
elems = node_val.split(',') if node_val else []
to_add = ["'partner_id': partner_id"]
node.set('context', '{' + ', '.join(elems + to_add) + '}')
node_val = node.get('context', '{}')
node_val.replace("{", "{'partner_id': partner_id, ", 1,)
node.set('context', node_val)
res['arch'] = etree.tostring(doc)
return res

Expand Down
1 change: 1 addition & 0 deletions sale_commission/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
* Oihane Crucelaegui <oihanecruce@gmail.com>
* Nicola Malcontenti <nicola.malcontenti@agilebg.com>
* Aitor Bouzas <aitor.bouzas@adaptivecity.com>
* Rodrigo Bonilla <rodrigo.bonilla@factorlibre.com>

0 comments on commit c38ece3

Please sign in to comment.