mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[UPD][IMP] @murtuzasaleh remarks + search_count
[UPD] @murtuzasaleh remarks for readme.rst [IMP] use search_count
This commit is contained in:
@@ -14,13 +14,13 @@ Agreement - Project
|
|||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
|
||||||
:target: https://github.com/OCA/contract/tree/11.0/agreement_project
|
:target: https://github.com/OCA/contract/tree/12.0/agreement_project
|
||||||
:alt: OCA/contract
|
:alt: OCA/contract
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||||
:target: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-agreement_project
|
:target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_project
|
||||||
:alt: Translate me on Weblate
|
:alt: Translate me on Weblate
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||||
:target: https://runbot.odoo-community.org/runbot/110/11.0
|
:target: https://runbot.odoo-community.org/runbot/110/12.0
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
@@ -107,6 +107,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|
|||||||
|
|
||||||
|maintainer-smangukiya| |maintainer-max3903|
|
|maintainer-smangukiya| |maintainer-max3903|
|
||||||
|
|
||||||
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/11.0/agreement_project>`_ project on GitHub.
|
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/12.0/agreement_project>`_ project on GitHub.
|
||||||
|
|
||||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ class Agreement(models.Model):
|
|||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _compute_task_count(self):
|
def _compute_task_count(self):
|
||||||
data = self.env['project.task'].read_group(
|
for ag in self:
|
||||||
[('agreement_id', 'in', self.ids)],
|
count = self.env['project.task'].search_count(
|
||||||
['agreement_id'], ['agreement_id'])
|
[('agreement_id', 'in', self.ids)])
|
||||||
count_data = dict((item['agreement_id'][0],
|
ag.task_count = count
|
||||||
item['agreement_id_count']) for item in data)
|
|
||||||
for agreement in self:
|
|
||||||
agreement.task_count = count_data.get(agreement.id, 0)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user