From da4cf6d55c933ce8de12c03bd2c599e41e8521ba Mon Sep 17 00:00:00 2001 From: "Amit Vora (OpenERP)" Date: Wed, 26 Feb 2014 11:46:23 +0530 Subject: [PATCH 1/9] [FIX] override copy method to avoid duplicate child ids lp bug: https://launchpad.net/bugs/1256437 fixed bzr revid: voraamitr@gmail.com-20140226061623-255kguaytkex9a8m --- addons/hr/hr.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 2cdb964f45f..4f262fae7a1 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -211,7 +211,14 @@ class hr_employee(osv.osv): } _order='name_related' - + + def copy(self, cr, uid, ids, default=None, context=None): + if default is None: + default = {} + default = default.copy() + default.update({'child_ids': False}) + return super(hr_employee, self).copy(cr, uid, ids, default, context=context) + def create(self, cr, uid, data, context=None): employee_id = super(hr_employee, self).create(cr, uid, data, context=context) try: @@ -302,6 +309,13 @@ class res_users(osv.osv): _name = 'res.users' _inherit = 'res.users' + def copy(self, cr, uid, ids, default=None, context=None): + if default is None: + default = {} + default = default.copy() + default.update({'employee_ids': False}) + return super(res_users, self).copy(cr, uid, ids, default, context=context) + def create(self, cr, uid, data, context=None): user_id = super(res_users, self).create(cr, uid, data, context=context) From d77b000aff4f842b111eaea035b33350ac3e287d Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 23 Apr 2014 14:14:11 +0200 Subject: [PATCH 2/9] [FIX] Don't reset an existing but empty mail.catchall.domain bzr revid: stefan@therp.nl-20140423121411-l3qyijr6fnsexrtn --- addons/mail/res_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/res_config.py b/addons/mail/res_config.py index 91606e1c720..0e2e362d07b 100644 --- a/addons/mail/res_config.py +++ b/addons/mail/res_config.py @@ -33,14 +33,14 @@ class project_configuration(osv.TransientModel): } def get_default_alias_domain(self, cr, uid, ids, context=None): - alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", context=context) - if not alias_domain: + alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", default=None, context=context) + if alias_domain is None: domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "web.base.url", context=context) try: alias_domain = urlparse.urlsplit(domain).netloc.split(':')[0] except Exception: pass - return {'alias_domain': alias_domain} + return {'alias_domain': alias_domain or False} def set_alias_domain(self, cr, uid, ids, context=None): config_parameters = self.pool.get("ir.config_parameter") From a918e8999502d7e70c94de772b53035b74a87f38 Mon Sep 17 00:00:00 2001 From: Jacques-Etienne Baudoux <> Date: Mon, 5 May 2014 11:43:29 +0200 Subject: [PATCH 3/9] [FIX] mail: change copy call to copy_data to avoid resending email during duplication (opw 607295) bzr revid: mat@openerp.com-20140505094329-vr7h4c92i43ezob4 --- addons/mail/mail_thread.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 83f3693e3be..90ae3cf0aa3 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -316,14 +316,14 @@ class mail_thread(osv.AbstractModel): fol_obj.unlink(cr, SUPERUSER_ID, fol_ids, context=context) return res - def copy(self, cr, uid, id, default=None, context=None): + def copy_data(self, cr, uid, id, default=None, context=None): # avoid tracking multiple temporary changes during copy context = dict(context or {}, mail_notrack=True) default = default or {} default['message_ids'] = [] default['message_follower_ids'] = [] - return super(mail_thread, self).copy(cr, uid, id, default=default, context=context) + return super(mail_thread, self).copy_data(cr, uid, id, default=default, context=context) #------------------------------------------------------ # Automatically log tracked fields From 5f5fd653db5608da3facb0d9179c8555b7027a0a Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of openerp <> Date: Tue, 6 May 2014 07:27:15 +0000 Subject: [PATCH 4/9] Launchpad automatic translations update. bzr revid: launchpad_translations_on_behalf_of_openerp-20140506072715-4m7kz3factf743c9 --- addons/account/i18n/nl.po | 8 ++++---- addons/stock/i18n/hr.po | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/account/i18n/nl.po b/addons/account/i18n/nl.po index 089d94953d5..ea39418274e 100644 --- a/addons/account/i18n/nl.po +++ b/addons/account/i18n/nl.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2013-06-14 22:29+0000\n" -"PO-Revision-Date: 2014-04-20 06:40+0000\n" +"PO-Revision-Date: 2014-05-05 10:40+0000\n" "Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" "Language-Team: Dutch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-04-21 05:08+0000\n" -"X-Generator: Launchpad (build 16985)\n" +"X-Launchpad-Export-Date: 2014-05-06 07:26+0000\n" +"X-Generator: Launchpad (build 16996)\n" #. module: account #: model:process.transition,name:account.process_transition_supplierreconcilepaid0 @@ -5133,7 +5133,7 @@ msgstr "" #: code:addons/account/report/common_report_header.py:68 #, python-format msgid "All Posted Entries" -msgstr "Alle geboekte boekingen" +msgstr "Alleen definitieve boekingen" #. module: account #: field:report.aged.receivable,name:0 diff --git a/addons/stock/i18n/hr.po b/addons/stock/i18n/hr.po index 7e484eca201..f387ab46671 100644 --- a/addons/stock/i18n/hr.po +++ b/addons/stock/i18n/hr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2014-02-06 15:56+0000\n" -"PO-Revision-Date: 2014-03-05 10:52+0000\n" +"PO-Revision-Date: 2014-05-05 09:49+0000\n" "Last-Translator: Marko Carevic \n" "Language-Team: Croatian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-06 06:15+0000\n" -"X-Generator: Launchpad (build 16948)\n" +"X-Launchpad-Export-Date: 2014-05-06 07:27+0000\n" +"X-Generator: Launchpad (build 16996)\n" #. module: stock #: field:stock.inventory.line.split,line_exist_ids:0 @@ -1070,7 +1070,7 @@ msgstr "Pošiljke u dolasku" #: help:stock.picking.in,date:0 #: help:stock.picking.out,date:0 msgid "Creation date, usually the time of the order." -msgstr "Datum kreiranja, obično vrijeme naloga" +msgstr "Datum naloga" #. module: stock #: view:report.stock.inventory:0 @@ -1754,7 +1754,7 @@ msgstr "" #: field:stock.production.lot,date:0 #: field:stock.tracking,date:0 msgid "Creation Date" -msgstr "Datum kreiranja" +msgstr "Datum naloga" #. module: stock #: field:report.stock.lines.date,id:0 @@ -4558,7 +4558,7 @@ msgstr "_Primjeni" #: field:stock.picking.in,max_date:0 #: field:stock.picking.out,max_date:0 msgid "Max. Expected Date" -msgstr "Max. Expected Date" +msgstr "Krajnji očekivani datum" #. module: stock #: field:stock.picking,auto_picking:0 From 883f695b6794e3b5ce6f938b4e04e4de45090a07 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 7 May 2014 12:24:14 +0200 Subject: [PATCH 5/9] [FIX] auth_oauth: missing field body in formview The body is the field used to actually display the 'log in with ...' As not shown in the view, when adding a new provider, this field was empty and therefore wasnt visible on the login form... bzr revid: dle@openerp.com-20140507102414-vz7ur7zvh4ptuk2e --- addons/auth_oauth/auth_oauth_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/auth_oauth/auth_oauth_view.xml b/addons/auth_oauth/auth_oauth_view.xml index ffc39752ec6..5c889d3a686 100644 --- a/addons/auth_oauth/auth_oauth_view.xml +++ b/addons/auth_oauth/auth_oauth_view.xml @@ -11,6 +11,7 @@ + From 95ba80f174a71cbf14b1d94f1c02527fe8d04a9f Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 7 May 2014 12:25:50 +0200 Subject: [PATCH 6/9] [FIX] warning: make blocking warning actually doing something (opw 607380) Instead of raising an exception (which only interupt the call of the onchange methods), return a dictionnary to set the forbidden partner or product to an empty value. The call is not blocking in a way it forbid to create a record that uses this partner/product but it make it not possible to select it through the web interface. bzr revid: mat@openerp.com-20140507102550-sms5nbf0u7pdkci9 --- addons/warning/warning.py | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/addons/warning/warning.py b/addons/warning/warning.py index a3627e0021d..c1a2f92a9fd 100644 --- a/addons/warning/warning.py +++ b/addons/warning/warning.py @@ -63,14 +63,14 @@ class sale_order(osv.osv): message = False partner = self.pool.get('res.partner').browse(cr, uid, part, context=context) if partner.sale_warn != 'no-message': - if partner.sale_warn == 'block': - raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.sale_warn_msg) title = _("Warning for %s") % partner.name message = partner.sale_warn_msg warning = { 'title': title, 'message': message, } + if partner.sale_warn == 'block': + return {'value': {'partner_id': False}, 'warning': warning} result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part, context=context) @@ -92,14 +92,15 @@ class purchase_order(osv.osv): message = False partner = self.pool.get('res.partner').browse(cr, uid, part) if partner.purchase_warn != 'no-message': - if partner.purchase_warn == 'block': - raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.purchase_warn_msg) title = _("Warning for %s") % partner.name message = partner.purchase_warn_msg warning = { 'title': title, 'message': message } + if partner.purchase_warn == 'block': + return {'value': {'partner_id': False}, 'warning': warning} + result = super(purchase_order, self).onchange_partner_id(cr, uid, ids, part) if result.get('warning',False): @@ -126,15 +127,16 @@ class account_invoice(osv.osv): message = False partner = self.pool.get('res.partner').browse(cr, uid, partner_id) if partner.invoice_warn != 'no-message': - if partner.invoice_warn == 'block': - raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.invoice_warn_msg) - title = _("Warning for %s") % partner.name message = partner.invoice_warn_msg warning = { 'title': title, 'message': message } + + if partner.invoice_warn == 'block': + return {'value': {'partner_id': False}, 'warning': warning} + result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice=date_invoice, payment_term=payment_term, partner_bank_id=partner_bank_id, company_id=company_id) @@ -158,14 +160,15 @@ class stock_picking(osv.osv): title = False message = False if partner.picking_warn != 'no-message': - if partner.picking_warn == 'block': - raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg) title = _("Warning for %s") % partner.name message = partner.picking_warn_msg warning = { 'title': title, 'message': message } + if partner.picking_warn == 'block': + return {'value': {'partner_id': False}, 'warning': warning} + result = super(stock_picking, self).onchange_partner_in(cr, uid, ids, partner_id, context) if result.get('warning',False): warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title'] @@ -188,14 +191,15 @@ class stock_picking_in(osv.osv): title = False message = False if partner.picking_warn != 'no-message': - if partner.picking_warn == 'block': - raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg) title = _("Warning for %s") % partner.name message = partner.picking_warn_msg warning = { 'title': title, 'message': message } + if partner.picking_warn == 'block': + return {'value': {'partner_id': False}, 'warning': warning} + result = super(stock_picking_in, self).onchange_partner_in(cr, uid, ids, partner_id, context) if result.get('warning',False): warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title'] @@ -214,14 +218,15 @@ class stock_picking_out(osv.osv): title = False message = False if partner.picking_warn != 'no-message': - if partner.picking_warn == 'block': - raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg) title = _("Warning for %s") % partner.name message = partner.picking_warn_msg warning = { 'title': title, 'message': message } + if partner.picking_warn == 'block': + return {'value': {'partner_id': False}, 'warning': warning} + result = super(stock_picking_out, self).onchange_partner_in(cr, uid, ids, partner_id, context) if result.get('warning',False): warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title'] @@ -262,12 +267,12 @@ class sale_order_line(osv.osv): message = False if product_info.sale_line_warn != 'no-message': - if product_info.sale_line_warn == 'block': - raise osv.except_osv(_('Alert for %s!') % (product_info.name), product_info.sale_line_warn_msg) title = _("Warning for %s") % product_info.name message = product_info.sale_line_warn_msg warning['title'] = title warning['message'] = message + if product_info.sale_line_warn == 'block': + return {'value': {'product_id': False}, 'warning': warning} result = super(sale_order_line, self).product_id_change( cr, uid, ids, pricelist, product, qty, uom, qty_uos, uos, name, partner_id, @@ -295,12 +300,12 @@ class purchase_order_line(osv.osv): message = False if product_info.purchase_line_warn != 'no-message': - if product_info.purchase_line_warn == 'block': - raise osv.except_osv(_('Alert for %s!') % (product_info.name), product_info.purchase_line_warn_msg) title = _("Warning for %s") % product_info.name message = product_info.purchase_line_warn_msg warning['title'] = title warning['message'] = message + if product_info.purchase_line_warn == 'block': + return {'value': {'product_id': False}, 'warning': warning} result = super(purchase_order_line, self).onchange_product_id(cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order, fiscal_position_id) From 0f9917c9a3245aa21efc427d3d7a7b1402c92c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 7 May 2014 13:06:37 +0200 Subject: [PATCH 7/9] [FIX] service: wrapper: fixed context fetching. Indeed call_kw set its context in kwargs of kwargs, leading to a kwargception. bzr revid: tde@openerp.com-20140507110637-qlj1rj8lrcpkejf6 --- openerp/service/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/service/model.py b/openerp/service/model.py index d65cbd77333..2bbba4ef72a 100644 --- a/openerp/service/model.py +++ b/openerp/service/model.py @@ -54,7 +54,8 @@ def check(f): if args and isinstance(args[-1], dict): ctx = args[-1] elif isinstance(kwargs, dict): - ctx = kwargs.get('context', {}) + # kwargception because call_kw set its context in kwargs['kwargs'] + ctx = kwargs.get('context', kwargs.get('kwargs', {}).get('context', {})) uid = 1 if args and isinstance(args[0], (long, int)): From ada19d175d530b616f88e7c3d81ec194f7ad6a0d Mon Sep 17 00:00:00 2001 From: Kersten Jeremy Date: Wed, 7 May 2014 14:01:44 +0200 Subject: [PATCH 8/9] [FIX] POS - Write the state to Paid before the create_picking. It's allow to stay in a valid state in workflow. And let the current stock picking out to 'Ready for delivery' bzr revid: jke@openerp.com-20140507120144-m177kqxa3fbfl37r --- addons/point_of_sale/point_of_sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 3480ab47221..0a2b96fd273 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1167,8 +1167,8 @@ class pos_order(osv.osv): return self.write(cr, uid, ids, {'state': 'payment'}, context=context) def action_paid(self, cr, uid, ids, context=None): - self.create_picking(cr, uid, ids, context=context) self.write(cr, uid, ids, {'state': 'paid'}, context=context) + self.create_picking(cr, uid, ids, context=context) return True def action_cancel(self, cr, uid, ids, context=None): From e0fb0a643429cb85f8f0e920460d0c3d810c772a Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 7 May 2014 15:35:52 +0200 Subject: [PATCH 9/9] [FIX] account: when creating partial reconcilation after unreconciliating one invoice, make sure we create this partial reconcilation only if we have at least two lines bzr revid: mat@openerp.com-20140507133552-v4qsdp7qdp9iwewi --- addons/account/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 61619276df7..4da965167ba 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1029,7 +1029,7 @@ class account_move_line(osv.osv): if opening_reconciliation: obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False}) obj_move_rec.unlink(cr, uid, unlink_ids) - if all_moves: + if len(all_moves) >= 2: obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context) return True