From 1bca1089ceae931f3f029428acffeba6200fac43 Mon Sep 17 00:00:00 2001 From: "pawan.sharma" Date: Fri, 12 Aug 2022 13:09:52 +0530 Subject: [PATCH] add project revenue as per month year --- project_revenue_amount/__init__.py | 2 + project_revenue_amount/__manifest__.py | 17 +++++++ project_revenue_amount/models/__init__.py | 1 + .../models/custom_project.py | 34 ++++++++++++++ .../security/ir.model.access.csv | 3 ++ .../views/custom_project.xml | 23 ++++++++++ project_revenue_amount/wizard/__init__.py | 1 + .../wizard/project_revenue_wizard.py | 44 +++++++++++++++++++ .../wizard/project_revenue_wizard.xml | 30 +++++++++++++ 9 files changed, 155 insertions(+) create mode 100644 project_revenue_amount/__init__.py create mode 100644 project_revenue_amount/__manifest__.py create mode 100644 project_revenue_amount/models/__init__.py create mode 100644 project_revenue_amount/models/custom_project.py create mode 100644 project_revenue_amount/security/ir.model.access.csv create mode 100644 project_revenue_amount/views/custom_project.xml create mode 100644 project_revenue_amount/wizard/__init__.py create mode 100644 project_revenue_amount/wizard/project_revenue_wizard.py create mode 100644 project_revenue_amount/wizard/project_revenue_wizard.xml diff --git a/project_revenue_amount/__init__.py b/project_revenue_amount/__init__.py new file mode 100644 index 0000000..c536983 --- /dev/null +++ b/project_revenue_amount/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard \ No newline at end of file diff --git a/project_revenue_amount/__manifest__.py b/project_revenue_amount/__manifest__.py new file mode 100644 index 0000000..28aae7a --- /dev/null +++ b/project_revenue_amount/__manifest__.py @@ -0,0 +1,17 @@ +{ + 'name': 'Project Revenue', + 'version': '1.0.1', + 'category': 'Project', + 'author': 'SunArc Technologies', + 'website': 'www.sunarctechnologies.com', + 'license': 'LGPL-3', + 'depends': ['base','hr','project'], + 'data': [ + 'wizard/project_revenue_wizard.xml', + 'security/ir.model.access.csv', + 'views/custom_project.xml', + ], + 'installable': True, + 'auto_install': False, + +} \ No newline at end of file diff --git a/project_revenue_amount/models/__init__.py b/project_revenue_amount/models/__init__.py new file mode 100644 index 0000000..c7262c0 --- /dev/null +++ b/project_revenue_amount/models/__init__.py @@ -0,0 +1 @@ +from . import custom_project diff --git a/project_revenue_amount/models/custom_project.py b/project_revenue_amount/models/custom_project.py new file mode 100644 index 0000000..365dbf4 --- /dev/null +++ b/project_revenue_amount/models/custom_project.py @@ -0,0 +1,34 @@ +from odoo import api, fields, models +from odoo.exceptions import UserError, AccessError, ValidationError +from datetime import datetime +from dateutil import relativedelta + + +class CustomProject(models.Model): + _inherit = 'project.project' + + revenue_amount_lines = fields.One2many('project.revenue.lines' , 'project_id') + + + + + + +class ProjectRevenueLines(models.Model): + _name = 'project.revenue.lines' + + + project_id = fields.Many2one('project.project') + start_date = fields.Datetime(required=True) + end_date = fields.Datetime(compute='_compute_end_date',store=True) + fixed_amount = fields.Float() + + + + + + + + + + diff --git a/project_revenue_amount/security/ir.model.access.csv b/project_revenue_amount/security/ir.model.access.csv new file mode 100644 index 0000000..d3f1176 --- /dev/null +++ b/project_revenue_amount/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_project_revenue_lines,access.project.revenue.lines,model_project_revenue_lines,,1,1,1,0 +access_project_revenue_wizard,access.project.revenue.wizard,model_project_revenue_wizard,,1,1,1,0 diff --git a/project_revenue_amount/views/custom_project.xml b/project_revenue_amount/views/custom_project.xml new file mode 100644 index 0000000..8d2f231 --- /dev/null +++ b/project_revenue_amount/views/custom_project.xml @@ -0,0 +1,23 @@ + + + project.edit.project.inherit + project.project + + + + +