diff --git a/mrp_production_project_estimated_cost/models/__init__.py b/mrp_production_project_estimated_cost/models/__init__.py index 7db71fe6f..4199c5cfa 100644 --- a/mrp_production_project_estimated_cost/models/__init__.py +++ b/mrp_production_project_estimated_cost/models/__init__.py @@ -18,5 +18,4 @@ from . import account_analytic_line from . import mrp_production from . import product -from . import project_project from . import mrp_bom diff --git a/mrp_production_project_estimated_cost/models/mrp_production.py b/mrp_production_project_estimated_cost/models/mrp_production.py index 25267486c..6419e43c4 100644 --- a/mrp_production_project_estimated_cost/models/mrp_production.py +++ b/mrp_production_project_estimated_cost/models/mrp_production.py @@ -86,7 +86,6 @@ class MrpProduction(models.Model): cond = [('mrp_production_id', '=', production.id)] analytic_line_obj.search(cond).unlink() if production.project_id.automatic_creation: - production.project_id.unlink() analytic_lines = analytic_line_obj.search( [('account_id', '=', production.analytic_account_id.id)]) if not analytic_lines: @@ -99,27 +98,6 @@ class MrpProduction(models.Model): self.calculate_production_estimated_cost() return res - @api.multi - def action_compute(self, properties=None): - project_obj = self.env['project.project'] - res = super(MrpProduction, self).action_compute(properties=properties) - for record in self: - if not record.project_id: - project = project_obj.search([('name', '=', record.name)], - limit=1) - if not project: - project_vals = { - 'name': record.name, - 'use_tasks': True, - 'use_timesheets': True, - 'use_issues': True, - 'automatic_creation': True, - } - project = project_obj.create(project_vals) - record.project_id = project.id - record.analytic_account_id = project.analytic_account_id.id - return res - @api.multi def action_show_estimated_costs(self): self.ensure_one() diff --git a/mrp_production_project_estimated_cost/models/project_project.py b/mrp_production_project_estimated_cost/models/project_project.py deleted file mode 100644 index 1c5c05013..000000000 --- a/mrp_production_project_estimated_cost/models/project_project.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## - -from openerp import models, fields - - -class ProjectProject(models.Model): - - _inherit = 'project.project' - - automatic_creation = fields.Boolean('Automatic Creation')