diff --git a/project_revenue_amount/__init__.py b/project_revenue_amount/__init__.py old mode 100644 new mode 100755 diff --git a/project_revenue_amount/__manifest__.py b/project_revenue_amount/__manifest__.py old mode 100644 new mode 100755 diff --git a/project_revenue_amount/models/__init__.py b/project_revenue_amount/models/__init__.py old mode 100644 new mode 100755 diff --git a/project_revenue_amount/models/custom_project.py b/project_revenue_amount/models/custom_project.py old mode 100644 new mode 100755 index 365dbf4..be8e21c --- a/project_revenue_amount/models/custom_project.py +++ b/project_revenue_amount/models/custom_project.py @@ -9,18 +9,12 @@ class CustomProject(models.Model): 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) + start_date = fields.Date(required=True) + end_date = fields.Date(required=True) fixed_amount = fields.Float() @@ -30,5 +24,3 @@ class ProjectRevenueLines(models.Model): - - diff --git a/project_revenue_amount/security/ir.model.access.csv b/project_revenue_amount/security/ir.model.access.csv old mode 100644 new mode 100755 diff --git a/project_revenue_amount/views/custom_project.xml b/project_revenue_amount/views/custom_project.xml old mode 100644 new mode 100755 diff --git a/project_revenue_amount/wizard/__init__.py b/project_revenue_amount/wizard/__init__.py old mode 100644 new mode 100755 diff --git a/project_revenue_amount/wizard/project_revenue_wizard.py b/project_revenue_amount/wizard/project_revenue_wizard.py old mode 100644 new mode 100755 index a2fbb57..b036bda --- a/project_revenue_amount/wizard/project_revenue_wizard.py +++ b/project_revenue_amount/wizard/project_revenue_wizard.py @@ -8,16 +8,22 @@ 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) + start_date = fields.Date(required=True) + #end_date = fields.Datet(compute='_compute_end_date', store=True) + end_date = fields.Date() 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) + @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) + if self.start_date: + self.end_date = self.start_date + relativedelta.relativedelta(months=1) - relativedelta.relativedelta(days=1) def action_set_revenue_lines(self): values = { diff --git a/project_revenue_amount/wizard/project_revenue_wizard.xml b/project_revenue_amount/wizard/project_revenue_wizard.xml old mode 100644 new mode 100755