[IMP] sale_timesheet: remove assign SO item action

If timesheets are recorded on tasks that aren't linked to any Sales
Order, the user can assign a SOL (in batch) later on by going to the
Action > Assign Sale Order Item.  Since the introduction of FSM, the
user can directly create Sales Orders from the Project Overview and
from Tasks. This makes the "Assign Sale Order Item" action redundant.

This commit removes this action.

Task-1968074

closes odoo/odoo#32696

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
This commit is contained in:
Geoffroy Larue
2019-05-08 07:02:53 +00:00
parent b5b7396b84
commit 84fd8db144
4 changed files with 0 additions and 65 deletions
-1
View File
@@ -26,7 +26,6 @@ have real delivered quantities in sales orders.
'views/hr_timesheet_templates.xml',
'report/project_profitability_report_analysis_views.xml',
'data/sale_timesheet_filters.xml',
'wizard/project_task_assign_so_line_views.xml',
'wizard/project_create_sale_order_views.xml',
'wizard/project_create_invoice_views.xml',
],
-1
View File
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import project_task_assign_so_line
from . import project_create_sale_order
from . import project_create_invoice
@@ -1,29 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ProjectTaskAssignSOLine(models.TransientModel):
_name = 'project.task.assign.sale'
_description = "Assign Sale Order line to tasks"
@api.model
def default_get(self, fields):
result = super(ProjectTaskAssignSOLine, self).default_get(fields)
if self._context.get('active_model') == 'project.task' and 'task_ids' in fields:
result['task_ids'] = self._context.get('active_ids', [])
return result
sale_line_id = fields.Many2one('sale.order.line', 'Sales Order Item', domain=[('is_service', '=', True)], help="Sale order line to link to selected tasks")
partner_id = fields.Many2one('res.partner', related='sale_line_id.order_partner_id', readonly=True)
task_ids = fields.Many2many('project.task', 'project_task_assign_so_line_rel', 'task_id', 'wizard_id', string='Tasks', domain=[('parent_id', '=', False)], help="Select the tasks to assign to the Sale Order Items. You can only choose task (no sub tasks).")
@api.multi
def action_assign_sale_line(self):
for wizard in self:
wizard.task_ids.write({
'sale_line_id': wizard.sale_line_id.id,
'partner_id': wizard.partner_id.id,
})
return {'type': 'ir.actions.act_window_close'}
@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="project_task_assign_so_line_view_form" model="ir.ui.view">
<field name="name">project.task.assign.sale.wizard.form</field>
<field name="model">project.task.assign.sale</field>
<field name="arch" type="xml">
<form string="Assign sale line to Tasks">
<group>
<field name="task_ids" widget="many2many_tags"/>
<field name="sale_line_id" options="{'no_create_edit': True}" context="{'sale_show_order_product_name': True}"/>
<field name="partner_id"/>
</group>
<footer>
<button string="Assign" type="object" name="action_assign_sale_line" class="oe_highlight"/>
<button string="Cancel" special="cancel" type="object" class="btn btn-secondary oe_inline"/>
</footer>
</form>
</field>
</record>
<record id="project_task_action_multi_assign_so_line" model="ir.actions.act_window">
<field name="name">Assign Sale Order Item</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">project.task.assign.sale</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="project_task_assign_so_line_view_form"/>
<field name="target">new</field>
<field name="multi">True</field>
<field name="binding_model_id" ref="project.model_project_task"/>
</record>
</odoo>