[FIX] base/populate: do not empty populated list during population.

The population of res users was emptying the list of populated partner
ids.

The lunch.supplier population was crashing because no partner id was
present in the partner population registry to use as `partner_id` for
the generated lunch suppliers.

closes odoo/odoo#50266

X-original-commit: a2adc346906ee753df6d8e49caa4ee5381629695
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is contained in:
Victor Feyens
2020-04-28 06:36:59 +00:00
parent 11c60739e4
commit 1eabd8e60a
+1 -1
View File
@@ -16,7 +16,7 @@ class Users(models.Model):
_populate_dependencies = ["res.partner"]
def _populate_factories(self):
partner_ids = self.env.registry.populated_models["res.partner"]
partner_ids = list(self.env.registry.populated_models["res.partner"])
def get_partner_id(random=None, **kwargs):
partner_id = random.choice(partner_ids)