mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] agreement_project: Migration to 14.0
This commit is contained in:
@@ -4,16 +4,13 @@
|
||||
{
|
||||
"name": "Agreement - Project",
|
||||
"summary": "Link projects to an agreement",
|
||||
"version": "12.0.1.0.1",
|
||||
"version": "14.0.1.0.0",
|
||||
"category": "Contract",
|
||||
"author": "Open Source Integrators, "
|
||||
"Yves Goldberg (Ygol Internetwork), "
|
||||
"Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/contract",
|
||||
"depends": [
|
||||
"agreement_legal",
|
||||
"project",
|
||||
],
|
||||
"depends": ["agreement_legal", "project"],
|
||||
"data": [
|
||||
"views/agreement_view.xml",
|
||||
"views/project_view.xml",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (C) 2018 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class Agreement(models.Model):
|
||||
@@ -9,7 +9,6 @@ class Agreement(models.Model):
|
||||
|
||||
task_count = fields.Integer("# Tasks", compute="_compute_task_count")
|
||||
|
||||
@api.multi
|
||||
def _compute_task_count(self):
|
||||
for ag in self:
|
||||
count = self.env["project.task"].search_count(
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
* Sandip Mangukiya <smangukiya@opensourceintegrators.com>
|
||||
* Yves Goldberg <yves@ygol.com>
|
||||
* Helly kapatel <helly.kapatel@initos.com>
|
||||
|
||||
1
agreement_project/tests/__init__.py
Normal file
1
agreement_project/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_agreement
|
||||
12
agreement_project/tests/test_agreement.py
Normal file
12
agreement_project/tests/test_agreement.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from odoo.tests.common import SavepointCase
|
||||
|
||||
|
||||
class TestAgreement(SavepointCase):
|
||||
def test_agreement(self):
|
||||
self = self.env["agreement"].search([])
|
||||
for ag in self:
|
||||
ag._compute_task_count()
|
||||
count = self.env["project.task"].search_count(
|
||||
[("agreement_id", "=", ag.id)]
|
||||
)
|
||||
ag.task_count = count
|
||||
@@ -5,7 +5,6 @@
|
||||
<field name="name">Tasks</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('agreement_id', '=', active_id)]</field>
|
||||
<field name="help" type="html">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="model">project.project</field>
|
||||
<field name="inherit_id" ref="project.edit_project" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="sequence" position="after">
|
||||
<field name="allowed_portal_user_ids" position="after">
|
||||
<field name="agreement_id" domain="[('partner_id', '=', partner_id)]" />
|
||||
</field>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user