diff --git a/partner_changeset/README.rst b/partner_changeset/README.rst index 8b9ab712b..1d0d46887 100644 --- a/partner_changeset/README.rst +++ b/partner_changeset/README.rst @@ -136,7 +136,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed `feedback +help us smash it by providing detailed and welcomed feedback. Credits ======= diff --git a/partner_changeset/models/res_partner.py b/partner_changeset/models/res_partner.py index fa6da68d3..0a85815b2 100644 --- a/partner_changeset/models/res_partner.py +++ b/partner_changeset/models/res_partner.py @@ -14,16 +14,16 @@ class ResPartner(models.Model): readonly=True) count_pending_changesets = fields.Integer( string='Changes', - compute='_count_pending_changesets', + compute='_compute_count_pending_changesets', search='_search_count_pending_changesets') - @api.one @api.depends('changeset_ids', 'changeset_ids.state') - def _count_pending_changesets(self): - changesets = self.changeset_ids.filtered( - lambda rev: rev.state == 'draft' and rev.partner_id == self - ) - self.count_pending_changesets = len(changesets) + def _compute_count_pending_changesets(self): + for res in self: + changesets = res.changeset_ids.filtered( + lambda rev: rev.state == 'draft' and rev.partner_id == res + ) + res.count_pending_changesets = len(changesets) @api.multi def write(self, values): @@ -39,6 +39,7 @@ class ResPartner(models.Model): def _search_count_pending_changesets(self, operator, value): if operator not in ('=', '!=', '<', '<=', '>', '>=', 'in', 'not in'): return [] + # pylint: disable=sql-injection query = ("SELECT p.id " "FROM res_partner p " "INNER JOIN res_partner_changeset r ON r.partner_id = p.id " diff --git a/partner_changeset/models/res_partner_changeset.py b/partner_changeset/models/res_partner_changeset.py index 380096456..e53f7c9c2 100644 --- a/partner_changeset/models/res_partner_changeset.py +++ b/partner_changeset/models/res_partner_changeset.py @@ -52,14 +52,14 @@ class ResPartnerChangeset(models.Model): models = self.env['ir.model'].search([]) return [(model.model, model.name) for model in models] - @api.one @api.depends('change_ids', 'change_ids.state') def _compute_state(self): - if all(change.state in ('done', 'cancel') for change - in self.mapped('change_ids')): - self.state = 'done' - else: - self.state = 'draft' + for res in self: + if all(change.state in ('done', 'cancel') for change + in res.mapped('change_ids')): + res.state = 'done' + else: + res.state = 'draft' @api.multi def apply(self): @@ -306,25 +306,25 @@ class ResPartnerChangesetChange(models.Model): _old_value_fields + _new_value_fields) - @api.one @api.depends('changeset_id.partner_id') def _compute_origin_values(self): - field_name = self.get_field_for_type(self.field_id, 'origin') - if self.state == 'draft': - value = self.changeset_id.partner_id[self.field_id.name] - else: - old_field = self.get_field_for_type(self.field_id, 'old') - value = self[old_field] - setattr(self, field_name, value) + for res in self: + field_name = res.get_field_for_type(res.field_id, 'origin') + if res.state == 'draft': + value = res.changeset_id.partner_id[res.field_id.name] + else: + old_field = res.get_field_for_type(res.field_id, 'old') + value = res[old_field] + setattr(res, field_name, value) - @api.one @api.depends(lambda self: self._value_fields) def _compute_value_display(self): - for prefix in ('origin', 'new'): - value = getattr(self, 'get_%s_value' % prefix)() - if self.field_id.ttype == 'many2one' and value: - value = value.display_name - setattr(self, '%s_value_display' % prefix, value) + for res in self: + for prefix in ('origin', 'new'): + value = getattr(res, 'get_%s_value' % prefix)() + if res.field_id.ttype == 'many2one' and value: + value = value.display_name + setattr(res, '%s_value_display' % prefix, value) @api.model def get_field_for_type(self, field, prefix): diff --git a/partner_contact_height/README.rst b/partner_contact_height/README.rst index 59ff1bf92..49095021f 100644 --- a/partner_contact_height/README.rst +++ b/partner_contact_height/README.rst @@ -21,11 +21,6 @@ To use this module, you need to: :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/134/9.0 -Known issues / Roadmap -====================== - -* ... - Bug Tracker =========== @@ -60,4 +55,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit https://odoo-community.org. diff --git a/partner_contact_nutrition/README.rst b/partner_contact_nutrition/README.rst index 2319a04c0..2293be293 100644 --- a/partner_contact_nutrition/README.rst +++ b/partner_contact_nutrition/README.rst @@ -26,11 +26,6 @@ To use this module, you need to: :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/134/9.0 -Known issues / Roadmap -====================== - -* ... - Bug Tracker =========== @@ -65,4 +60,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit https://odoo-community.org. diff --git a/partner_contact_weight/README.rst b/partner_contact_weight/README.rst index 5a1e514ec..4d1fcf479 100644 --- a/partner_contact_weight/README.rst +++ b/partner_contact_weight/README.rst @@ -21,11 +21,6 @@ To use this module, you need to: :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/134/9.0 -Known issues / Roadmap -====================== - -* ... - Bug Tracker =========== @@ -60,4 +55,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit https://odoo-community.org. diff --git a/partner_identification/README.rst b/partner_identification/README.rst index 891529c36..1b1a59862 100644 --- a/partner_identification/README.rst +++ b/partner_identification/README.rst @@ -15,7 +15,7 @@ and vary from country to country. * Fiscal ID's * Membership numbers * Driver license -* ... +* … Installation diff --git a/partner_identification/__openerp__.py b/partner_identification/__openerp__.py index 11c0f0d9e..340f13613 100644 --- a/partner_identification/__openerp__.py +++ b/partner_identification/__openerp__.py @@ -19,10 +19,10 @@ 'security/ir.model.access.csv', ], 'author': 'ChriCar Beteiligungs- und Beratungs- GmbH, ' - 'Antiun Ingeniería S.L.', - 'Camptocamp,' - 'ACSONE SA/NV,' - 'Odoo Community Association (OCA)' + 'Antiun Ingeniería S.L., ' + 'Camptocamp, ' + 'ACSONE SA/NV, ' + 'Odoo Community Association (OCA)', 'website': 'https://odoo-community.org/', 'license': 'AGPL-3', 'installable': True,