Skip to content
Permalink
Browse files

fixup sale_project_ts

  • Loading branch information...
jem-odoo committed Apr 12, 2019
1 parent 61bbca3 commit 8d0c3a4df0a5002be6a6016a99e4e16df2207d30
@@ -10,7 +10,7 @@ class ProductTemplate(models.Model):

service_tracking = fields.Selection(selection_add=[
('task_global_project', 'Create a task in an existing project'),
('task_in_project', 'Create a task in a new project'),
('task_in_project', 'Create a task in sale order\'s project'),
('project_only', 'Create a new project but no task'),
])
project_id = fields.Many2one(
@@ -335,7 +335,7 @@ def _plan_prepare_actions(self, values):
actions.append({
'label': _("Create a Sales Order"),
'type': 'action',
'action_id': 'sale_timesheet.project_project_action_multi_create_sale_order',
'action_id': 'sale_project_timesheet.project_project_action_multi_create_sale_order',
'context': json.dumps({'active_id': self.id, 'active_model': 'project.project'}),
})
if self.env.user.has_group('sales_team.group_sale_salesman_all_leads'):
@@ -353,7 +353,7 @@ def _plan_prepare_actions(self, values):
actions.append({
'label': _("Create Invoice"),
'type': 'action',
'action_id': 'sale_timesheet.project_project_action_multi_create_invoice',
'action_id': 'sale_project_timesheet.project_project_action_multi_create_invoice',
'context': json.dumps({'active_id': self.id, 'active_model': 'project.project'}),
})
return actions
@@ -554,13 +554,20 @@ var BasicRenderer = AbstractRenderer.extend({
* @returns {jQueryElement}
*/
_renderFieldWidget: function (node, record, options) {
console.log(node);
console.log(record);
console.log(options);
console.log('--------------');
options = options || {};
var fieldName = node.attrs.name;
// Register the node-associated modifiers
var mode = options.mode || this.mode;
var modifiers = this._registerModifiers(node, record, null, options);
// Initialize and register the widget
// Readonly status is known as the modifiers have just been registered
if (node.attrs.widget == 'timesheet_uom') {
//debugger;
}
var Widget = record.fieldsInfo[this.viewType][fieldName].Widget;
var widget = new Widget(this, fieldName, record, {
mode: modifiers.readonly ? 'readonly' : mode,
@@ -326,6 +326,7 @@ var ListRenderer = BasicRenderer.extend({
tdClassName += ' o_list_button';
} else if (node.tag === 'field') {
var typeClass = FIELD_CLASSES[this.state.fields[node.attrs.name].type];

if (typeClass) {
tdClassName += (' ' + typeClass);
}

0 comments on commit 8d0c3a4

Please sign in to comment.
You can’t perform that action at this time.