diff --git a/addons/account/account.py b/addons/account/account.py index fa30b20f2ca..907e6207380 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -582,6 +582,8 @@ class account_account(osv.osv): def name_get(self, cr, uid, ids, context=None): if not ids: return [] + if isinstance(ids, (int, long)): + ids = [ids] reads = self.read(cr, uid, ids, ['name', 'code'], context=context) res = [] for record in reads: diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 012bde42eff..7bc9ceaaf61 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1127,7 +1127,7 @@ class account_invoice(osv.osv): return map(lambda x: (0,0,x), lines) def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None): - invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id']) + invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'company_id']) obj_invoice_line = self.pool.get('account.invoice.line') obj_invoice_tax = self.pool.get('account.invoice.tax') obj_journal = self.pool.get('account.journal') @@ -1175,7 +1175,7 @@ class account_invoice(osv.osv): 'name': description, }) # take the id part of the tuple returned for many2one fields - for field in ('partner_id', + for field in ('partner_id', 'company_id', 'account_id', 'currency_id', 'payment_term', 'journal_id'): invoice[field] = invoice[field] and invoice[field][0] # create the new invoice diff --git a/addons/anonymization/anonymization_view.xml b/addons/anonymization/anonymization_view.xml index 6d11dbe37fb..1a6c6c355d5 100644 --- a/addons/anonymization/anonymization_view.xml +++ b/addons/anonymization/anonymization_view.xml @@ -1,6 +1,6 @@ - + @@ -76,7 +76,7 @@ - + Anonymize Database @@ -163,4 +163,3 @@ - diff --git a/addons/base_report_designer/wizard/base_report_design_view.xml b/addons/base_report_designer/wizard/base_report_design_view.xml index 434feea954b..d2ee1f70dc3 100644 --- a/addons/base_report_designer/wizard/base_report_design_view.xml +++ b/addons/base_report_designer/wizard/base_report_design_view.xml @@ -1,6 +1,7 @@ - + + Base Report sxw base.report.sxw @@ -17,7 +18,7 @@ - + Base Report sxw @@ -43,7 +44,8 @@ - + + Base Report File sxw base.report.rml.save @@ -55,6 +57,5 @@ - diff --git a/addons/board/static/src/css/dashboard.css b/addons/board/static/src/css/dashboard.css index f3d300add2e..6907b4271a0 100644 --- a/addons/board/static/src/css/dashboard.css +++ b/addons/board/static/src/css/dashboard.css @@ -50,6 +50,13 @@ content: "+"; margin-left: 4px; } +.openerp .oe_dashboard .oe_action .oe_header .oe_header_text { + visibility: hidden; + cursor: text; +} +.openerp .oe_dashboard .oe_action .oe_header span { + cursor: pointer; +} .openerp .oe_dashboard .oe_action .oe_header_empty { padding-top: 0; padding-bottom: 2px; diff --git a/addons/board/static/src/css/dashboard.sass b/addons/board/static/src/css/dashboard.sass index dd4d144e918..4bacc7bd892 100644 --- a/addons/board/static/src/css/dashboard.sass +++ b/addons/board/static/src/css/dashboard.sass @@ -49,6 +49,11 @@ .oe_maximize:after content: "+" margin-left: 4px + .oe_header_text + visibility: hidden + cursor: text + span + cursor: pointer .oe_header_empty padding-top: 0 padding-bottom: 2px diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index b9df81bf868..c1561ac6e16 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -22,12 +22,15 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ connectWith: '.oe_dashboard_column', handle: '.oe_header', scroll: false - }).disableSelection().bind('sortstop', self.do_save_dashboard); + }).bind('sortstop', self.do_save_dashboard); // Events this.$element.find('.oe_dashboard_link_reset').click(this.on_reset); this.$element.find('.oe_dashboard_link_change_layout').click(this.on_change_layout); - + this.$element.find('h2.oe_header span.oe_header_txt').click(function(ev){ + if(ev.target === ev.currentTarget) + self.on_header_string($(ev.target).parent()); + }); this.$element.delegate('.oe_dashboard_column .oe_fold', 'click', this.on_fold_action); this.$element.delegate('.oe_dashboard_column .oe_close', 'click', this.on_close_action); @@ -46,6 +49,30 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ }); }); }, + on_header_string:function(h2){ + var self = this; + var span = h2.find('span:first').hide(); + var input = h2.find('.oe_header_text').css('visibility','visible'); + var attr = h2.closest(".oe_action").data('action_attrs'); + var change_string = function(new_name){ + attr['string'] = new_name; + span.text(new_name).show(); + input.css('visibility','hidden'); + self.do_save_dashboard(); + } + input.unbind() + .val(span.text()) + .change(function(event){ + change_string($(this).val()); + }) + .keyup(function(event){ + if(event.keyCode == 27){ + //esc key to cancel changes + input.css('visibility','hidden'); + span.show(); + } + }); + }, on_reset: function() { this.rpc('/web/view/undo_custom', { view_id: this.view.fields_view.view_id, diff --git a/addons/board/static/src/xml/board.xml b/addons/board/static/src/xml/board.xml index 13d81d11f8d..b2363cafd53 100644 --- a/addons/board/static/src/xml/board.xml +++ b/addons/board/static/src/xml/board.xml @@ -23,13 +23,15 @@ - + + Create + diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 0ecc7d9bee2..c4423520847 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -294,6 +294,7 @@ class crm_lead(base_stage, osv.osv): def on_change_partner(self, cr, uid, ids, partner_id, context=None): result = {} + values = {} if partner_id: partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) values = { diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 47b0c323622..12c5dc0af6d 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -267,16 +267,16 @@ - - - + + + - + diff --git a/addons/hr_payroll_account/hr_payroll_account.py b/addons/hr_payroll_account/hr_payroll_account.py index 71621874066..7156735636b 100644 --- a/addons/hr_payroll_account/hr_payroll_account.py +++ b/addons/hr_payroll_account/hr_payroll_account.py @@ -108,7 +108,7 @@ class hr_payslip(osv.osv): 'journal_id': slip.journal_id.id, 'period_id': period_id, } - for line in slip.line_ids: + for line in slip.details_by_salary_rule_category: amt = slip.credit_note and -line.total or line.total partner_id = line.salary_rule_id.register_id.partner_id and line.salary_rule_id.register_id.partner_id.id or default_partner_id debit_account_id = line.salary_rule_id.account_debit.id diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index d552dc108a4..c7f77208149 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -1168,7 +1168,7 @@ class mail_thread(osv.Model): """ When creating a new message, set as unread if uid is not the object responsible. """ for obj in self.browse(cr, uid, ids, context=context): - if obj.message_state and self._columns.get('user_id') and (not obj.user_id or obj.user_id.id != uid): + if obj.message_state and ('user_id' in obj._columns.keys()) and (not obj.user_id or obj.user_id.id != uid) : self.message_mark_as_unread(cr, uid, [obj.id], context=context) def message_check_and_set_unread(self, cr, uid, ids, context=None): diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 5c440976b5c..4fb75c0333c 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -580,8 +580,9 @@ class account_analytic_account(osv.osv): return res def _trigger_project_creation(self, cr, uid, vals, context=None): + if context is None: context = {} res = super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context) - return res or vals.get('use_issues') + return res or (vals.get('use_issues') and not 'project_creation_in_progress' in context) account_analytic_account() diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index 4ab6251c7a2..f4bd4fee425 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -78,7 +78,7 @@ class purchase_report(osv.osv): to_char(s.date_order, 'YYYY-MM-DD') as day, s.state, s.date_approve, - date_trunc('day',s.minimum_planned_date) as expected_date, + s.minimum_planned_date as expected_date, s.dest_address_id, s.pricelist_id, s.validator, @@ -117,7 +117,7 @@ class purchase_report(osv.osv): s.date_approve, l.date_planned, l.product_uom, - date_trunc('day',s.minimum_planned_date), + s.minimum_planned_date, s.pricelist_id, s.validator, s.dest_address_id, @@ -129,7 +129,7 @@ class purchase_report(osv.osv): to_char(s.date_order, 'YYYY-MM-DD'), s.state, s.warehouse_id, - u.uom_type, + u.uom_type, u.category_id, t.uom_id, u.id, diff --git a/addons/sale/wizard/sale_make_invoice_advance.xml b/addons/sale/wizard/sale_make_invoice_advance.xml index 5bb7d231e94..97e9c843683 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.xml +++ b/addons/sale/wizard/sale_make_invoice_advance.xml @@ -22,6 +22,9 @@ attrs="{'invisible': [('advance_payment_method', '!=', 'percentage')]}"/> + + + diff --git a/addons/web_linkedin/static/src/js/linkedin.js b/addons/web_linkedin/static/src/js/linkedin.js index 575a4cf9a85..f0befb9e6ac 100644 --- a/addons/web_linkedin/static/src/js/linkedin.js +++ b/addons/web_linkedin/static/src/js/linkedin.js @@ -78,16 +78,12 @@ openerp.web_linkedin = function(instance) { }, _.bind(this.linkedin_disabled, this)); }, linkedin_disabled: function() { - if (instance.session.uid !== 1) { - instance.web.dialog($(QWeb.render("LinkedIn.DisabledWarning")), { - title: _t("LinkedIn is not enabled"), - buttons: [ - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} - ] - }); - } else { - new instance.web_linkedin.KeyWizard(this).open(); - } + instance.web.dialog($(QWeb.render("LinkedIn.DisabledWarning")), { + title: _t("LinkedIn is not enabled"), + buttons: [ + {text: _t("Ok"), click: function() { $(this).dialog("close"); }} + ] + }); }, selected_entity: function(entity) { var self = this; @@ -272,24 +268,5 @@ openerp.web_linkedin = function(instance) { } }, }); - - - instance.web_linkedin.KeyWizard = instance.web.Dialog.extend({ - template: "LinkedIn.KeyWizard", - init: function(parent, text) { - this._super(parent, {title:_t("LinkedIn API Key")}); - this.api_domain = window.location.origin; - }, - start: function() { - this._super(); - var self = this; - this.$("button").click(function() { - var value = self.$("input").val(); - return new instance.web.Model("ir.config_parameter").call("set_param", ["web.linkedin.apikey", value]).pipe(function() { - self.destroy(); - }); - }); - }, - }); }; // vim:et fdc=0 fdl=0: diff --git a/addons/web_linkedin/static/src/xml/linkedin.xml b/addons/web_linkedin/static/src/xml/linkedin.xml index 30a7abb3443..1a8009ab066 100644 --- a/addons/web_linkedin/static/src/xml/linkedin.xml +++ b/addons/web_linkedin/static/src/xml/linkedin.xml @@ -30,30 +30,7 @@ LinkedIn access was not enabled on this server. - Please ask your administrator to activate it. - - - - - - To use the LinkedIn module with this database, an API Key is required. Please follow this procedure: - - - Go to this URL: - https://www.linkedin.com/secure/developer. - - Log into LinkedIn. - Add a new application and fill the form: - - JavaScript API Domain: - The programming tool is Javascript - - - Copy the API key here: - - Apply - - + Please ask your administrator to configure it in Settings > Configuration > Linkedin. \ No newline at end of file diff --git a/addons/web_linkedin/web_linkedin.py b/addons/web_linkedin/web_linkedin.py index 5c8ffc57cb5..2a6ba24042e 100644 --- a/addons/web_linkedin/web_linkedin.py +++ b/addons/web_linkedin/web_linkedin.py @@ -28,6 +28,7 @@ except ImportError: import base64 import urllib2 +from osv import osv, fields class Binary(openerpweb.Controller): _cp_path = "/web_linkedin/binary" @@ -36,4 +37,19 @@ class Binary(openerpweb.Controller): def url2binary(self, req,url): bfile = urllib2.urlopen(url) return base64.b64encode(bfile.read()) + +class web_linkedin_settings(osv.osv_memory): + _name = 'web_linkedin.settings' + _inherit = 'res.config.settings' + _columns = { + 'api_key': fields.char(string="API Key", size=50), + } + + def get_default_linkedin(self, cr, uid, fields, context=None): + key = self.pool.get("ir.config_parameter").get_param(cr, uid, "web.linkedin.apikey") or "" + return {'api_key': key} + + def set_linkedin(self, cr, uid, ids, context=None): + key = self.browse(cr, uid, ids[0], context)["api_key"] or "" + self.pool.get("ir.config_parameter").set_param(cr, uid, "web.linkedin.apikey", key) diff --git a/addons/web_linkedin/web_linkedin_view.xml b/addons/web_linkedin/web_linkedin_view.xml index b636722e2c7..a3b73ec94dc 100644 --- a/addons/web_linkedin/web_linkedin_view.xml +++ b/addons/web_linkedin/web_linkedin_view.xml @@ -10,12 +10,55 @@ - + + + linkedin_settings + web_linkedin.settings + + + + + or + + + + + To use the LinkedIn module with this database, an API Key is required. Please follow this procedure: + + + Go to this URL: + https://www.linkedin.com/secure/developer. + + Log into LinkedIn. + Add a new application and fill the form: + + JavaScript API Domain: the domain of the url used to log into this database (example: http://localhost:8069) + The programming tool is Javascript + + + Copy the API key down here: + + + + + + + + + + + Configure Linkedin + ir.actions.act_window + web_linkedin.settings + form + inline + + + + +
- To use the LinkedIn module with this database, an API Key is required. Please follow this procedure: -
+ To use the LinkedIn module with this database, an API Key is required. Please follow this procedure: +