Browse Source

Merge PR #1215 into 14.0

Signed-off-by simahawk
14.0
OCA-git-bot 3 years ago
parent
commit
cf50391714
  1. 3
      animal_owner/models/res_partner.py
  2. 8
      partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py
  3. 8
      partner_pricelist_search/models/product_pricelist.py

3
animal_owner/models/res_partner.py

@ -17,7 +17,8 @@ class ResPartner(models.Model):
)
def action_view_animals(self):
action = self.env.ref("animal.action_animal").read()[0]
xmlid = "animal.action_animal"
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
if self.animal_count > 1:
action["domain"] = [("id", "in", self.animal_ids.ids)]
else:

8
partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py

@ -156,7 +156,8 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
"'search_show_all_positions': " "{'is_set': True, 'set_value': False}"
)
details = self.env.ref("base.action_partner_form").read()[0]
xmlid = "base.action_partner_form"
details = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
self.assertIn(
new_context_val,
@ -164,9 +165,8 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
msg="Default actions not updated with new context",
)
details = self.env.ref(
"partner_contact_in_several_companies.action_partner_form"
).read()[0]
xmlid = "partner_contact_in_several_companies.action_partner_form"
details = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
self.assertNotIn(
new_context_val,

8
partner_pricelist_search/models/product_pricelist.py

@ -13,9 +13,9 @@ class Pricelist(models.Model):
else:
domain = [("property_product_pricelist", "in", self.ids)]
partners = self.env["res.partner"].search(domain)
action = self.env.ref("base.action_partner_form")
res = action.read()[0]
res["domain"] = [
xmlid = "base.action_partner_form"
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
action["domain"] = [
("id", "in", partners.ids),
]
return res
return action
Loading…
Cancel
Save