[MERGE] merge with trunk
bzr revid: fka@tinyerp.com-20121022130216-ax5ddjc3fjcm0g1w
This commit is contained in:
@@ -11,7 +11,7 @@ openerp.account = function (instance) {
|
||||
this._super.apply(this, arguments);
|
||||
var self = this;
|
||||
this.current_partner = null;
|
||||
this.do_select.add(function() {
|
||||
this.on('record_selected', this, function() {
|
||||
if (self.get_selected_ids().length === 0) {
|
||||
self.$(".oe_account_recon_reconcile").attr("disabled", "");
|
||||
} else {
|
||||
@@ -19,7 +19,7 @@ openerp.account = function (instance) {
|
||||
}
|
||||
});
|
||||
},
|
||||
on_loaded: function() {
|
||||
load_list: function() {
|
||||
var self = this;
|
||||
var tmp = this._super.apply(this, arguments);
|
||||
if (this.partners) {
|
||||
@@ -102,7 +102,6 @@ openerp.account = function (instance) {
|
||||
action_id: result[1],
|
||||
context: additional_context
|
||||
}).then(function (result) {
|
||||
result = result.result;
|
||||
result.context = _.extend(result.context || {}, additional_context);
|
||||
result.flags = result.flags || {};
|
||||
result.flags.new_window = true;
|
||||
@@ -121,6 +120,10 @@ openerp.account = function (instance) {
|
||||
self.do_search(self.last_domain, self.last_context, self.last_group_by);
|
||||
});
|
||||
},
|
||||
do_select: function (ids, records) {
|
||||
this.trigger('record_selected')
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_meeting"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_meeting_read" model="ir.values">
|
||||
<field name="name">action_crm_meeting_read</field>
|
||||
@@ -28,7 +28,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_meeting"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_meeting_unread" model="ir.values">
|
||||
<field name="name">action_crm_meeting_unread</field>
|
||||
|
||||
@@ -38,7 +38,7 @@ openerp.base_import = function (instance) {
|
||||
// if true, the 'Import', 'Export', etc... buttons will be shown
|
||||
instance.web.ListView.prototype.defaults.import_enabled = true;
|
||||
instance.web.ListView.include({
|
||||
on_loaded: function () {
|
||||
load_list: function () {
|
||||
var self = this;
|
||||
var add_button = false;
|
||||
if (!this.$buttons) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_lead_unread" model="ir.values">
|
||||
<field name="name">action_crm_lead_unread</field>
|
||||
@@ -27,7 +27,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_lead_read" model="ir.values">
|
||||
<field name="name">action_crm_lead_read</field>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_phonecall"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_phonecall_unread" model="ir.values">
|
||||
<field name="name">action_crm_phonecall_unread</field>
|
||||
@@ -27,7 +27,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_phonecall"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_phonecall_read" model="ir.values">
|
||||
<field name="name">action_crm_phonecall_read</field>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_event_event"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_event_event_unread" model="ir.values">
|
||||
<field name="name">action_event_event_unread</field>
|
||||
@@ -82,7 +82,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_event_event"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_event_event_read" model="ir.values">
|
||||
<field name="name">action_event_event_read</field>
|
||||
@@ -384,7 +384,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_event_registration"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_event_registration_unread" model="ir.values">
|
||||
<field name="name">action_event_registration_unread</field>
|
||||
@@ -402,7 +402,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_event_registration"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_event_registration_read" model="ir.values">
|
||||
<field name="name">action_event_registration_read</field>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_hr_holidays"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_holidays_unread" model="ir.values">
|
||||
<field name="name">action_holidays_unread</field>
|
||||
@@ -26,7 +26,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_hr_holidays"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_holidays_read" model="ir.values">
|
||||
<field name="name">action_holidays_read</field>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_hr_applicant"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_applicant_unread" model="ir.values">
|
||||
<field name="name">action_project_unread</field>
|
||||
@@ -60,7 +60,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_hr_applicant"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_applicant_read" model="ir.values">
|
||||
<field name="name">action_project_read</field>
|
||||
|
||||
@@ -1055,8 +1055,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
||||
this.pos.barcode_reader.disconnect();
|
||||
return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id']).pipe(
|
||||
_.bind(function(res) {
|
||||
return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(result) {
|
||||
var action = result.result;
|
||||
return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(action) {
|
||||
action.context = _.extend(action.context || {}, {'cancel_action': {type: 'ir.actions.client', tag: 'reload'}});
|
||||
//self.destroy();
|
||||
this.do_action(action);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_project_project"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_project_unread" model="ir.values">
|
||||
<field name="name">action_project_unread</field>
|
||||
@@ -44,7 +44,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_project_project"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_project_read" model="ir.values">
|
||||
<field name="name">action_project_read</field>
|
||||
@@ -135,6 +135,7 @@
|
||||
<field name="resource_calendar_id"/>
|
||||
</group>
|
||||
<group string="Miscellaneous" name="misc">
|
||||
<field name="date_start"/>
|
||||
<field name="date" string="End Date"/>
|
||||
<field name="priority" groups="base.group_no_one"/>
|
||||
<field name="active" attrs="{'invisible':[('state','in',['open', 'pending', 'template'])]}"/>
|
||||
@@ -144,7 +145,7 @@
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Tasks Stages">
|
||||
<page string="Tasks Stages" attrs="{'invisible': [('use_tasks', '=', False)]}">
|
||||
<field name="type_ids"/>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -340,7 +341,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_project_task"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_project_task_unread" model="ir.values">
|
||||
<field name="name">action_project_task_unread</field>
|
||||
@@ -358,7 +359,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_project_task"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_project_task_read" model="ir.values">
|
||||
<field name="name">action_project_task_read</field>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_project_issue"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_project_issue_unread" model="ir.values">
|
||||
<field name="name">action_project_issue_unread</field>
|
||||
@@ -29,7 +29,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_project_issue"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_project_issue_read" model="ir.values">
|
||||
<field name="name">action_project_issue_read</field>
|
||||
|
||||
@@ -46,12 +46,15 @@ class project_project(osv.osv):
|
||||
|
||||
def open_timesheets(self, cr, uid, ids, context=None):
|
||||
""" open Timesheets view """
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
|
||||
project = self.browse(cr, uid, ids[0], context)
|
||||
view_context = {
|
||||
'search_default_account_id': [project.analytic_account_id.id],
|
||||
'default_account_id': project.analytic_account_id.id,
|
||||
}
|
||||
help = _("""<p class="oe_view_nocontent_create">Record your timesheets for the project '%s'.</p>""")
|
||||
help = _("""<p class="oe_view_nocontent_create">Record your timesheets for the project '%s'.</p>""") % (project.name,)
|
||||
try:
|
||||
if project.to_invoice and project.partner_id:
|
||||
help+= _("""<p>Timesheets on this project may be invoiced to %s, according to the terms defined in the contract.</p>""" ) % (project.partner_id.name,)
|
||||
@@ -59,16 +62,13 @@ class project_project(osv.osv):
|
||||
# if the user do not have access rights on the partner
|
||||
pass
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Timesheets'),
|
||||
'res_model': 'hr.analytic.timesheet',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'context': view_context,
|
||||
'nodestroy': True,
|
||||
'help': help
|
||||
}
|
||||
res = mod_obj.get_object_reference(cr, uid, 'hr_timesheet', 'act_hr_timesheet_line_evry1_all_form')
|
||||
id = res and res[1] or False
|
||||
result = act_obj.read(cr, uid, [id], context=context)[0]
|
||||
result['name'] = _('Timesheets')
|
||||
result['context'] = view_context
|
||||
result['help'] = help
|
||||
return result
|
||||
|
||||
project_project()
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_purchase_order"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_purchase_order_unread" model="ir.values">
|
||||
<field name="name">action_purchase_order_unread</field>
|
||||
@@ -157,7 +157,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_purchase_order"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_purchase_order_read" model="ir.values">
|
||||
<field name="name">action_purchase_order_read</field>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_sale_order"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_sale_order_unread" model="ir.values">
|
||||
<field name="name">action_sale_order_unread</field>
|
||||
@@ -91,7 +91,7 @@
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_sale_order"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_sale_order_read" model="ir.values">
|
||||
<field name="name">action_sale_order_read</field>
|
||||
|
||||
Reference in New Issue
Block a user