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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project_revenue_amount/wizard/__init__.py b/project_revenue_amount/wizard/__init__.py
new file mode 100644
index 0000000..07cd8de
--- /dev/null
+++ b/project_revenue_amount/wizard/__init__.py
@@ -0,0 +1 @@
+from . import project_revenue_wizard
diff --git a/project_revenue_amount/wizard/project_revenue_wizard.py b/project_revenue_amount/wizard/project_revenue_wizard.py
new file mode 100644
index 0000000..a2fbb57
--- /dev/null
+++ b/project_revenue_amount/wizard/project_revenue_wizard.py
@@ -0,0 +1,44 @@
+from odoo import api, fields, models
+from odoo.exceptions import UserError, AccessError, ValidationError
+from datetime import datetime
+from dateutil import relativedelta
+
+
+class CustomProjectWizard(models.TransientModel):
+ _name = 'project.revenue.wizard'
+
+ 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()
+
+ @api.depends('start_date')
+ def _compute_end_date(self):
+ for rec in self:
+ if rec.start_date:
+ rec.end_date = rec.start_date + relativedelta.relativedelta(months=1) - relativedelta.relativedelta(
+ days=1)
+
+ def action_set_revenue_lines(self):
+ values = {
+ 'project_id':self.project_id.id,
+ 'start_date':self.start_date,
+ 'end_date':self.end_date,
+ 'fixed_amount':self.fixed_amount
+ }
+ res = self.env['project.revenue.lines'].create(values)
+ return res
+
+ @api.onchange('start_date')
+ def _onchange_start_date(self):
+ active_id = self._context.get('active_ids', [])
+ project_object = self.env['project.project'].search([('id', '=', active_id[0])])
+ records = self.env['project.revenue.lines'].sudo().search([('project_id', '=', project_object.id)])
+ if self.start_date:
+ if self.start_date.day != 1:
+ raise AccessError('Please select first date of month')
+ else:
+ self.project_id = project_object.id
+ for line in records:
+ if self.start_date >= line.start_date and self.start_date <= line.end_date:
+ raise AccessError('Date already exist')
diff --git a/project_revenue_amount/wizard/project_revenue_wizard.xml b/project_revenue_amount/wizard/project_revenue_wizard.xml
new file mode 100644
index 0000000..559f8b4
--- /dev/null
+++ b/project_revenue_amount/wizard/project_revenue_wizard.xml
@@ -0,0 +1,30 @@
+
+
+ project.edit.project.inherit,wizard
+ project.revenue.wizard
+
+
+
+
+
+
+ Project Revenue wizard
+ project.revenue.wizard
+
+ new
+ { 'default_project_id': active_id, 'project_id': active_id }
+
+
\ No newline at end of file