mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] agreement_project: black, isort, prettier
This commit is contained in:
@@ -2,28 +2,28 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Agreement - Project',
|
"name": "Agreement - Project",
|
||||||
'summary': 'Link projects to an agreement',
|
"summary": "Link projects to an agreement",
|
||||||
'version': '12.0.1.0.1',
|
"version": "12.0.1.0.1",
|
||||||
'category': 'Contract',
|
"category": "Contract",
|
||||||
'author': 'Open Source Integrators, '
|
"author": "Open Source Integrators, "
|
||||||
'Yves Goldberg (Ygol Internetwork), '
|
"Yves Goldberg (Ygol Internetwork), "
|
||||||
'Odoo Community Association (OCA)',
|
"Odoo Community Association (OCA)",
|
||||||
'website': 'https://github.com/OCA/contract',
|
"website": "https://github.com/OCA/contract",
|
||||||
'depends': [
|
"depends": [
|
||||||
'agreement_legal',
|
"agreement_legal",
|
||||||
'project',
|
"project",
|
||||||
],
|
],
|
||||||
'data': [
|
"data": [
|
||||||
'views/agreement_view.xml',
|
"views/agreement_view.xml",
|
||||||
'views/project_view.xml',
|
"views/project_view.xml",
|
||||||
],
|
],
|
||||||
'installable': True,
|
"installable": True,
|
||||||
'license': 'AGPL-3',
|
"license": "AGPL-3",
|
||||||
'development_status': 'Beta',
|
"development_status": "Beta",
|
||||||
'maintainers': [
|
"maintainers": [
|
||||||
'smangukiya',
|
"smangukiya",
|
||||||
'ygol',
|
"ygol",
|
||||||
'max3903',
|
"max3903",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ from odoo import api, fields, models
|
|||||||
class Agreement(models.Model):
|
class Agreement(models.Model):
|
||||||
_inherit = "agreement"
|
_inherit = "agreement"
|
||||||
|
|
||||||
task_count = fields.Integer('# Tasks',
|
task_count = fields.Integer("# Tasks", compute="_compute_task_count")
|
||||||
compute='_compute_task_count')
|
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _compute_task_count(self):
|
def _compute_task_count(self):
|
||||||
for ag in self:
|
for ag in self:
|
||||||
count = self.env['project.task'].search_count(
|
count = self.env["project.task"].search_count(
|
||||||
[('agreement_id', '=', ag.id)])
|
[("agreement_id", "=", ag.id)]
|
||||||
|
)
|
||||||
ag.task_count = count
|
ag.task_count = count
|
||||||
|
|||||||
@@ -7,13 +7,12 @@ from odoo import fields, models
|
|||||||
class ProjectProject(models.Model):
|
class ProjectProject(models.Model):
|
||||||
_inherit = "project.project"
|
_inherit = "project.project"
|
||||||
|
|
||||||
agreement_id = fields.Many2one('agreement', 'Agreement')
|
agreement_id = fields.Many2one("agreement", "Agreement")
|
||||||
|
|
||||||
|
|
||||||
class ProjectTask(models.Model):
|
class ProjectTask(models.Model):
|
||||||
_inherit = "project.task"
|
_inherit = "project.task"
|
||||||
|
|
||||||
agreement_id = fields.Many2one('agreement',
|
agreement_id = fields.Many2one(
|
||||||
related="project_id.agreement_id",
|
"agreement", related="project_id.agreement_id", string="Agreement", store=True
|
||||||
string='Agreement',
|
)
|
||||||
store=True)
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record model="ir.actions.act_window"
|
<record model="ir.actions.act_window" id="action_project_task_agreement_specific">
|
||||||
id="action_project_task_agreement_specific">
|
|
||||||
<field name="name">Tasks</field>
|
<field name="name">Tasks</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">project.task</field>
|
<field name="res_model">project.task</field>
|
||||||
@@ -19,16 +18,18 @@
|
|||||||
<record id="partner_agreement_form_view_task" model="ir.ui.view">
|
<record id="partner_agreement_form_view_task" model="ir.ui.view">
|
||||||
<field name="name">agreement.form.task</field>
|
<field name="name">agreement.form.task</field>
|
||||||
<field name="model">agreement</field>
|
<field name="model">agreement</field>
|
||||||
<field name="inherit_id" ref="agreement_legal.partner_agreement_form_view"/>
|
<field name="inherit_id" ref="agreement_legal.partner_agreement_form_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//div[@name='button_box']" position="inside">
|
<xpath expr="//div[@name='button_box']" position="inside">
|
||||||
<button name="%(action_project_task_agreement_specific)d"
|
<button
|
||||||
type="action"
|
name="%(action_project_task_agreement_specific)d"
|
||||||
class="oe_stat_button" icon="fa-tasks">
|
type="action"
|
||||||
|
class="oe_stat_button"
|
||||||
|
icon="fa-tasks"
|
||||||
|
>
|
||||||
<div class="o_field_widget o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
<span class="o_stat_value">
|
<span class="o_stat_value">
|
||||||
<field name="task_count" widget="statinfo"
|
<field name="task_count" widget="statinfo" nolabel="1" />
|
||||||
nolabel="1"/>
|
|
||||||
</span>
|
</span>
|
||||||
<span class="o_stat_text">Tasks</span>
|
<span class="o_stat_text">Tasks</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,24 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="edit_project_agreement" model="ir.ui.view">
|
<record id="edit_project_agreement" model="ir.ui.view">
|
||||||
<field name="name">project.project.form.agreement</field>
|
<field name="name">project.project.form.agreement</field>
|
||||||
<field name="model">project.project</field>
|
<field name="model">project.project</field>
|
||||||
<field name="inherit_id" ref="project.edit_project"/>
|
<field name="inherit_id" ref="project.edit_project" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="sequence" position="after">
|
<field name="sequence" position="after">
|
||||||
<field name="agreement_id"
|
<field name="agreement_id" domain="[('partner_id', '=', partner_id)]" />
|
||||||
domain="[('partner_id', '=', partner_id)]"/>
|
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="view_task_form2_agreement" model="ir.ui.view">
|
<record id="view_task_form2_agreement" model="ir.ui.view">
|
||||||
<field name="name">project.task.form.agreement</field>
|
<field name="name">project.task.form.agreement</field>
|
||||||
<field name="model">project.task</field>
|
<field name="model">project.task</field>
|
||||||
<field name="inherit_id" ref="project.view_task_form2"/>
|
<field name="inherit_id" ref="project.view_task_form2" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='user_id']" position="after">
|
<xpath expr="//field[@name='user_id']" position="after">
|
||||||
<field name="agreement_id" readonly="1"/>
|
<field name="agreement_id" readonly="1" />
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
1
setup/agreement_project/odoo/addons/agreement_project
Symbolic link
1
setup/agreement_project/odoo/addons/agreement_project
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../../agreement_project
|
||||||
6
setup/agreement_project/setup.py
Normal file
6
setup/agreement_project/setup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user