From 419cd911fbd82ec61ac00b43d31e260f1378cdf3 Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Tue, 23 Oct 2012 14:29:01 +0530 Subject: [PATCH 01/11] [FIX][trunk] 7.0 Error when I choose transaction from Favourites (Star) lp bug: https://launchpad.net/bugs/1067245 fixed bzr revid: pan@tinyerp.com-20121023085901-r2wp6zlqyto4yvox --- addons/web_shortcuts/static/src/js/web_shortcuts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_shortcuts/static/src/js/web_shortcuts.js b/addons/web_shortcuts/static/src/js/web_shortcuts.js index fe955379c21..406ef036252 100644 --- a/addons/web_shortcuts/static/src/js/web_shortcuts.js +++ b/addons/web_shortcuts/static/src/js/web_shortcuts.js @@ -82,7 +82,7 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({ // TODO: Use do_action({menu_id: id, type: 'ir.actions.menu'}) self.rpc('/web/menu/action', {'menu_id': id}).then(function(ir_menu_data) { if (ir_menu_data.action.length){ - instance.webclient.user_menu.on_action({action_id: ir_menu_data.action[0][2].id}); + instance.webclient.user_menu.getParent().on_menu_action({action_id: ir_menu_data.action[0][2].id}); } }); this.$el.find('.oe_systray_shortcuts').trigger('mouseout'); From 28706d4967c5ea15032383b5bd5afa8130a25a62 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 24 Oct 2012 10:33:24 +0200 Subject: [PATCH 02/11] [FIX] stock, picking.in: fixed crash at the record creation bzr revid: qdp-launchpad@openerp.com-20121024083324-wog22at3yamadrsd --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 765599aa842..3b40dfb1dfc 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -618,7 +618,7 @@ class stock_picking(osv.osv): def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): - seq_obj_name = 'stock.picking.' + vals['type'] + seq_obj_name = self._name vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name) new_id = super(stock_picking, self).create(cr, user, vals, context) if new_id: From b526278aa1182f2f6d191a1a94a0102be9a3e7ff Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 24 Oct 2012 10:58:42 +0200 Subject: [PATCH 03/11] [IMP] sale_crm depends on sale, not sale_stock bzr revid: qdp-launchpad@openerp.com-20121024085842-98edk5c5twqi1rqw --- addons/sale_crm/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_crm/__openerp__.py b/addons/sale_crm/__openerp__.py index 88608af8922..82e267337f9 100644 --- a/addons/sale_crm/__openerp__.py +++ b/addons/sale_crm/__openerp__.py @@ -37,7 +37,7 @@ modules. 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', 'images': ['images/crm_statistics_dashboard.jpeg', 'images/opportunity_to_quote.jpeg'], - 'depends': ['sale_stock', 'crm'], + 'depends': ['sale', 'crm'], 'data': [ 'wizard/crm_make_sale_view.xml', 'sale_crm_view.xml', From e21795c3a10b4dcabb5155e7e02682a344b8f601 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 24 Oct 2012 11:06:25 +0200 Subject: [PATCH 04/11] [FIX] sale_margin depends on sale, not sale_stock bzr revid: qdp-launchpad@openerp.com-20121024090625-opgy3jr0ejlwtnq5 --- addons/sale_margin/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_margin/__openerp__.py b/addons/sale_margin/__openerp__.py index bb2f78f409c..badb87d3628 100644 --- a/addons/sale_margin/__openerp__.py +++ b/addons/sale_margin/__openerp__.py @@ -31,7 +31,7 @@ Price and Cost Price. """, 'author':'OpenERP SA', 'images':['images/sale_margin.jpeg'], - 'depends':['sale_stock'], + 'depends':['sale'], 'demo':['sale_margin_demo.xml'], 'test': ['test/sale_margin.yml'], 'data':['security/ir.model.access.csv','sale_margin_view.xml'], From 4cf738290511f54238240b928b63e67def16a312 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 24 Oct 2012 11:12:49 +0200 Subject: [PATCH 05/11] [IMP] account_voucher: improved error messages bzr revid: qdp-launchpad@openerp.com-20121024091249-b12vibq7h0fi41cj --- addons/account_voucher/account_voucher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 3ae421308b5..37a2343b72a 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -988,11 +988,11 @@ class account_voucher(osv.osv): if amount_residual > 0: account_id = line.voucher_id.company_id.expense_currency_exchange_account_id if not account_id: - raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Expense Currency Rate' on the company, then create accounting entry for currency rate difference.")) + raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Loss Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates.")) else: account_id = line.voucher_id.company_id.income_currency_exchange_account_id if not account_id: - raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Income Currency Rate' on the company, then create accounting entry for currency rate difference.")) + raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Gain Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates.")) # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise # the receivable/payable account may have a secondary currency, which render this field mandatory account_currency_id = company_currency <> current_currency and current_currency or False From ff6966da8b3efab5a7da14a089f5b6f510e14a90 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 24 Oct 2012 11:13:13 +0200 Subject: [PATCH 06/11] [IMP] account: added an option to enable/disable the check_total feature on supplier invoices bzr revid: qdp-launchpad@openerp.com-20121024091313-s6k3ekmsen5ntez4 --- addons/account/account_invoice.py | 7 +++++-- addons/account/account_invoice_view.xml | 1 + addons/account/res_config.py | 2 ++ addons/account/res_config_view.xml | 4 ++++ addons/account/security/account_security.xml | 5 +++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 0508a7cadfe..d3d37907538 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -865,8 +865,11 @@ class account_invoice(osv.osv): self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj) # I disabled the check_total feature - #if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0): - # raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.')) + group_check_total_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'group_supplier_inv_check_total')[1] + group_check_total = self.pool.get('res.groups').browse(cr, uid, group_check_total_id, context=context) + if group_check_total and uid in [x.id for x in group_check_total.users]: + if (inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0)): + raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe encoded total does not match the computed total.')) if inv.payment_term: total_fixed = total_percent = 0 diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 5ed373456f3..2699fffaacc 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -186,6 +186,7 @@ + diff --git a/addons/account/res_config.py b/addons/account/res_config.py index 17df4377548..ab271eabc34 100644 --- a/addons/account/res_config.py +++ b/addons/account/res_config.py @@ -120,6 +120,8 @@ class account_config_settings(osv.osv_memory): 'group_analytic_accounting': fields.boolean('Analytic accounting', implied_group='analytic.group_analytic_accounting', help="Allows you to use the analytic accounting."), + 'group_check_supplier_invoice_total': fields.boolean('Check the Total of Supplier Invoices', + implied_group="account.group_supplier_inv_check_total"), } def _default_company(self, cr, uid, context=None): diff --git a/addons/account/res_config_view.xml b/addons/account/res_config_view.xml index 728eefe8078..d4bafca41be 100644 --- a/addons/account/res_config_view.xml +++ b/addons/account/res_config_view.xml @@ -220,6 +220,10 @@