From 33c550f1c94088ac935964e39c94cbf8466886fd Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 Jan 2011 12:14:20 +0530 Subject: [PATCH 001/122] [IMP]partner:added suppliers menu domain bzr revid: gpa@tinyerp.com-20110111064420-9p05fwjsizqbtubz --- bin/addons/base/res/partner/partner_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/res/partner/partner_view.xml b/bin/addons/base/res/partner/partner_view.xml index 8c949a7f410..3f225f29e49 100644 --- a/bin/addons/base/res/partner/partner_view.xml +++ b/bin/addons/base/res/partner/partner_view.xml @@ -394,7 +394,7 @@ ir.actions.act_window res.partner form - [] + [('supplier','=',1)] {'default_customer':0, 'search_default_supplier': 1, 'default_supplier':1} You can access all information regarding your suppliers from the supplier form: accounting data, history of emails, meetings, purchases, etc. You can uncheck the 'Suppliers' filter button in order to search in all your partners, including customers and prospects. From 6a11b89e1729c6ac06efba1e75405e1ecd24dc8a Mon Sep 17 00:00:00 2001 From: Julien Thewys Date: Wed, 9 Feb 2011 11:07:35 +0100 Subject: [PATCH 002/122] [FIX] ensures no illegitimate cli argument is silently discarded This avoids an insidious behavior: when copy-pasting a command from a Microsoft document to the cmd terminal, one might not see that a hyphen ('-') preceding an option has been converted to a dash (u'\u2012') which is then interpreted as a normal cli argument (i.e. not an option) and thus silently discarded. bzr revid: jth@openerp.com-20110209100735-jaschhlv3cfqjry5 --- openerp/tools/config.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 7d0b04739e4..626720a43c2 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -251,12 +251,14 @@ class configmanager(object): self.parse_config() def parse_config(self, args=[]): - opt = self.parser.parse_args(args)[0] + opt, args = self.parser.parse_args() def die(cond, msg): if cond: - print msg - sys.exit(1) + self.parser.error(msg) + + # Ensures no illegitimate argument is silently discarded (avoids insidious "hyphen to dash" problem) + die(args, "unrecognized parameters were passed: '%s'" % " ".join(args)) die(bool(opt.syslog) and bool(opt.logfile), "the syslog and logfile options are exclusive") From 1984fc62cb3a96412b10337e43a2a56914fb3b07 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 17 Mar 2011 19:04:19 +0530 Subject: [PATCH 003/122] [FIX] account: journal seqence not respected lp bug: https://launchpad.net/bugs/726092 fixed bzr revid: ara@tinyerp.com-20110317133419-87dwll6uv39lw3cl --- addons/account/account_cash_statement.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index ff0f0117ff5..04e780ade30 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -320,6 +320,7 @@ class account_cash_statement(osv.osv): """ Changes statement state to Running. @return: True """ + obj_seq = self.pool.get('ir.sequence') if context is None: context = {} statement_pool = self.pool.get('account.bank.statement') @@ -329,15 +330,18 @@ class account_cash_statement(osv.osv): raise osv.except_osv(_('Error !'), (_('User %s does not have rights to access %s journal !') % (statement.user_id.name, statement.journal_id.name))) if statement.name and statement.name == '/': - number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement') + if statement.journal_id.sequence_id: + c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id} + st_number = obj_seq.get_id(cr, uid, statement.journal_id.sequence_id.id, context=c) + else: + st_number = obj_seq.get(cr, uid, 'account.cash.statement') vals.update({ - 'name': number + 'name': st_number }) vals.update({ 'date': time.strftime("%Y-%m-%d %H:%M:%S"), 'state': 'open', - }) self.write(cr, uid, [statement.id], vals, context=context) return True From 2f4a82f7f6318a9f2bfbfae0c056731209f00e5c Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Fri, 1 Apr 2011 18:18:04 +0530 Subject: [PATCH 004/122] [FIX] account: Cancel of invoice throws error, validate of move_id is invalid lp bug: https://launchpad.net/bugs/746544 fixed bzr revid: ara@tinyerp.com-20110401124804-rvbqlbaosphsqv8c --- addons/account/account_move_line.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 83a67df9178..e5c06213061 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1085,15 +1085,26 @@ class account_move_line(osv.osv): if context is None: context = {} move_obj = self.pool.get('account.move') + analytic_obj = self.pool.get('account.analytic.line') self._update_check(cr, uid, ids, context) result = False move_ids = set() + analytic_ids = set() + move_line_ids = set() for line in self.browse(cr, uid, ids, context=context): move_ids.add(line.move_id.id) context['journal_id'] = line.journal_id.id context['period_id'] = line.period_id.id - result = super(account_move_line, self).unlink(cr, uid, [line.id], context=context) + move_line_ids.add(line.id) + for obj in line.analytic_lines: + analytic_ids.add(obj.id) + + analytic_ids = list(analytic_ids) move_ids = list(move_ids) + + if analytic_ids: + analytic_obj.unlink(cr,uid, analytic_ids, context=context) + result = super(account_move_line, self).unlink(cr, uid, list(move_line_ids), context=context) if check and move_ids: move_obj.validate(cr, uid, move_ids, context=context) return result From 08695d543309b3f64581440f70037699861a337c Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 4 Apr 2011 12:09:17 +0530 Subject: [PATCH 005/122] [FIX] account: Cancel of invoice throws error, validate of move_id is invalid bzr revid: ara@tinyerp.com-20110404063917-kunaq8rj59pvvjsf --- addons/account/account_move_line.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index e5c06213061..2cbe9de9630 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1093,11 +1093,9 @@ class account_move_line(osv.osv): move_line_ids = set() for line in self.browse(cr, uid, ids, context=context): move_ids.add(line.move_id.id) - context['journal_id'] = line.journal_id.id - context['period_id'] = line.period_id.id move_line_ids.add(line.id) - for obj in line.analytic_lines: - analytic_ids.add(obj.id) + for analytic in line.analytic_lines: + analytic_ids.add(analytic.id) analytic_ids = list(analytic_ids) move_ids = list(move_ids) From ccbf1f434b8bf43e83dd0466dc9bfb226bb56f81 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 5 Apr 2011 10:50:41 +0530 Subject: [PATCH 006/122] [FIX]stock:Multiple UOM not handled by Inventory Analysis lp bug: https://launchpad.net/bugs/741457 fixed bzr revid: ron@tinyerp.com-20110405052041-hu8odbfg12cm2xc2 --- addons/stock/report/report_stock_move.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index 15e430d0599..f489b824062 100644 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -176,18 +176,23 @@ CREATE OR REPLACE view report_stock_inventory AS ( m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, m.company_id, m.state as state, m.prodlot_id as prodlot_id, - coalesce(sum(-m.product_qty * u.factor)::decimal, 0.0) as product_qty, - coalesce(sum(-pt.standard_price * m.product_qty * u.factor)::decimal, 0.0) as value + coalesce(sum(-pt.standard_price * m.product_qty)::decimal, 0.0) as value, + CASE when pt.uom_id = m.product_uom + THEN + coalesce(sum(-m.product_qty)::decimal, 0.0) + ELSE + coalesce(sum(-m.product_qty * pu.factor)::decimal, 0.0) END as product_qty FROM stock_move m LEFT JOIN stock_picking p ON (m.picking_id=p.id) LEFT JOIN product_product pp ON (m.product_id=pp.id) LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id) + LEFT JOIN product_uom pu ON (pt.uom_id=pu.id) LEFT JOIN product_uom u ON (m.product_uom=u.id) LEFT JOIN stock_location l ON (m.location_id=l.id) GROUP BY m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id, - m.prodlot_id, m.date, m.state, l.usage, m.company_id + m.prodlot_id, m.date, m.state, l.usage, m.company_id,pt.uom_id ) UNION ALL ( SELECT -m.id as id, m.date as date, @@ -195,18 +200,23 @@ CREATE OR REPLACE view report_stock_inventory AS ( m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, m.company_id, m.state as state, m.prodlot_id as prodlot_id, - coalesce(sum(m.product_qty*u.factor)::decimal, 0.0) as product_qty, - coalesce(sum(pt.standard_price * m.product_qty * u.factor)::decimal, 0.0) as value + coalesce(sum(pt.standard_price * m.product_qty )::decimal, 0.0) as value, + CASE when pt.uom_id = m.product_uom + THEN + coalesce(sum(m.product_qty)::decimal, 0.0) + ELSE + coalesce(sum(m.product_qty * pu.factor)::decimal, 0.0) END as product_qty FROM stock_move m LEFT JOIN stock_picking p ON (m.picking_id=p.id) LEFT JOIN product_product pp ON (m.product_id=pp.id) LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id) + LEFT JOIN product_uom pu ON (pt.uom_id=pu.id) LEFT JOIN product_uom u ON (m.product_uom=u.id) LEFT JOIN stock_location l ON (m.location_dest_id=l.id) GROUP BY m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id, - m.prodlot_id, m.date, m.state, l.usage, m.company_id + m.prodlot_id, m.date, m.state, l.usage, m.company_id,pt.uom_id ) ); """) From a21ecf80c5b18d00fb180f2d7237d63126d14ef8 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 5 Apr 2011 12:01:28 +0530 Subject: [PATCH 007/122] [REF]stock: Multiple UOM not handled by Inventory Analysis bzr revid: ron@tinyerp.com-20110405063128-73v7uoqq3h3kt59s --- addons/stock/report/report_stock_move.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index f489b824062..d2dbcb72a46 100644 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -177,11 +177,10 @@ CREATE OR REPLACE view report_stock_inventory AS ( m.company_id, m.state as state, m.prodlot_id as prodlot_id, coalesce(sum(-pt.standard_price * m.product_qty)::decimal, 0.0) as value, - CASE when pt.uom_id = m.product_uom - THEN - coalesce(sum(-m.product_qty)::decimal, 0.0) - ELSE - coalesce(sum(-m.product_qty * pu.factor)::decimal, 0.0) END as product_qty + case when pt.uom_id = m.product_uom then + coalesce(sum(-m.product_qty)::decimal, 0.0) + else + coalesce(sum(-m.product_qty * pu.factor)::decimal, 0.0) END as product_qty FROM stock_move m LEFT JOIN stock_picking p ON (m.picking_id=p.id) @@ -192,7 +191,7 @@ CREATE OR REPLACE view report_stock_inventory AS ( LEFT JOIN stock_location l ON (m.location_id=l.id) GROUP BY m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id, - m.prodlot_id, m.date, m.state, l.usage, m.company_id,pt.uom_id + m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id ) UNION ALL ( SELECT -m.id as id, m.date as date, @@ -201,11 +200,10 @@ CREATE OR REPLACE view report_stock_inventory AS ( m.company_id, m.state as state, m.prodlot_id as prodlot_id, coalesce(sum(pt.standard_price * m.product_qty )::decimal, 0.0) as value, - CASE when pt.uom_id = m.product_uom - THEN - coalesce(sum(m.product_qty)::decimal, 0.0) - ELSE - coalesce(sum(m.product_qty * pu.factor)::decimal, 0.0) END as product_qty + case when pt.uom_id = m.product_uom then + coalesce(sum(m.product_qty)::decimal, 0.0) + else + coalesce(sum(m.product_qty * pu.factor)::decimal, 0.0) END as product_qty FROM stock_move m LEFT JOIN stock_picking p ON (m.picking_id=p.id) @@ -216,7 +214,7 @@ CREATE OR REPLACE view report_stock_inventory AS ( LEFT JOIN stock_location l ON (m.location_dest_id=l.id) GROUP BY m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id, - m.prodlot_id, m.date, m.state, l.usage, m.company_id,pt.uom_id + m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id ) ); """) From 53d0655f2821566a9128e49aa8f188898934b706 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 5 Apr 2011 12:20:13 +0530 Subject: [PATCH 008/122] [REF]stock: Multiple UOM not handled by Inventory Analysis bzr revid: ron@tinyerp.com-20110405065013-4ntnsbij883vj5gi --- addons/stock/report/report_stock_move.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index d2dbcb72a46..07289a4379a 100644 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -177,9 +177,9 @@ CREATE OR REPLACE view report_stock_inventory AS ( m.company_id, m.state as state, m.prodlot_id as prodlot_id, coalesce(sum(-pt.standard_price * m.product_qty)::decimal, 0.0) as value, - case when pt.uom_id = m.product_uom then + CASE when pt.uom_id = m.product_uom THEN coalesce(sum(-m.product_qty)::decimal, 0.0) - else + ELSE coalesce(sum(-m.product_qty * pu.factor)::decimal, 0.0) END as product_qty FROM stock_move m @@ -200,9 +200,9 @@ CREATE OR REPLACE view report_stock_inventory AS ( m.company_id, m.state as state, m.prodlot_id as prodlot_id, coalesce(sum(pt.standard_price * m.product_qty )::decimal, 0.0) as value, - case when pt.uom_id = m.product_uom then + CASE when pt.uom_id = m.product_uom THEN coalesce(sum(m.product_qty)::decimal, 0.0) - else + ELSE coalesce(sum(m.product_qty * pu.factor)::decimal, 0.0) END as product_qty FROM stock_move m From e6ebac0a38ce43b4b8245714ad702375ca8183a0 Mon Sep 17 00:00:00 2001 From: "AMP (OpenERP)" Date: Tue, 5 Apr 2011 15:00:17 +0530 Subject: [PATCH 009/122] [FIX] crm_claim : claim history should not be deleted bzr revid: amp@tinyerp.com-20110405093017-hnob35dw5gt39x2t --- addons/crm_claim/crm_claim_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml index 63df2c35d0d..e7a0961a846 100644 --- a/addons/crm_claim/crm_claim_view.xml +++ b/addons/crm_claim/crm_claim_view.xml @@ -177,7 +177,7 @@ - +