[14.0][MIG]agreement_maintenance: Travis

This commit is contained in:
Vimal Patel
2021-07-23 15:39:00 +05:30
committed by Olga Marco
parent 029883a7af
commit 2c5c00dd61
9 changed files with 78 additions and 65 deletions

View File

@@ -7,11 +7,11 @@ from odoo import api, fields, models
class Agreement(models.Model):
_inherit = "agreement"
mr_count = fields.Integer('# Maintenance Requests',
compute='_compute_mr_count')
mr_count = fields.Integer("# Maintenance Requests", compute="_compute_mr_count")
@api.multi
def _compute_mr_count(self):
for ag_rec in self:
ag_rec.mr_count = self.env['maintenance.request'].search_count(
[('agreement_id', 'in', ag_rec.ids)])
ag_rec.mr_count = self.env["maintenance.request"].search_count(
[("agreement_id", "in", ag_rec.ids)]
)