Skip to content

Commit

Permalink
shopinvader: fix onchange() bug on unbind wizards
Browse files Browse the repository at this point in the history
  • Loading branch information
hparfr committed Jun 7, 2021
1 parent afb6c6b commit 8903144
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions shopinvader/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Sebastien BEAU <[email protected]>
* Simone Orsi <[email protected]>
* Laurent Mignon <[email protected]>
* Raphaël Reverdy <[email protected]>
10 changes: 4 additions & 6 deletions shopinvader/wizards/shopinvader_category_unbinding_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ class ShopinvaderCategoryUnbindingWizard(models.TransientModel):

@api.model
def default_get(self, fields_list):
result = super(ShopinvaderCategoryUnbindingWizard, self).default_get(
fields_list
)
shopinvader_category_ids = self.env.context.get("active_ids")
res = super(ShopinvaderCategoryUnbindingWizard, self).default_get(fields_list)
shopinvader_category_ids = self.env.context.get("active_ids", False)
if shopinvader_category_ids:
result.update({"shopinvader_category_ids": shopinvader_category_ids})
return result
res["shopinvader_category_ids"] = [(6, 0, shopinvader_category_ids)]
return res

def action_unbind_categories(self):
self.mapped("shopinvader_category_ids")._unbind()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def default_get(self, fields_list):
res = super(ShopinvaderVariantUnbindingWizard, self).default_get(fields_list)
shopinvader_variant_ids = self.env.context.get("active_ids", False)
if shopinvader_variant_ids:
res["shopinvader_variant_ids"] = shopinvader_variant_ids
res["shopinvader_variant_ids"] = [(6, 0, shopinvader_variant_ids)]
return res

def unbind_products(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<field name='shopinvader_variant_ids' />
<footer>
<button
string="UnBind Products"
string="Unbind Products"
name="unbind_products"
type="object"
class="oe_highlight"
Expand Down

0 comments on commit 8903144

Please sign in to comment.