From e9ae0b4906921dad23a9c6c3ce95994d2bfc5a21 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 8 Feb 2012 14:31:45 +0100 Subject: [PATCH 001/210] [IMP] Kanban: renamed button 'New' to 'Create' in order to match list view bzr revid: fme@openerp.com-20120208133145-jvx9u1i3tdvkw250 --- addons/web_kanban/static/src/xml/web_kanban.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_kanban/static/src/xml/web_kanban.xml b/addons/web_kanban/static/src/xml/web_kanban.xml index 3490b7a171f..fb506d6ffa7 100644 --- a/addons/web_kanban/static/src/xml/web_kanban.xml +++ b/addons/web_kanban/static/src/xml/web_kanban.xml @@ -2,7 +2,7 @@
- +
From 301afd4baa4b2cd8ae10f3de3fe525104f993d0a Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Wed, 8 Feb 2012 14:50:10 +0100 Subject: [PATCH 002/210] [REM] hide menutip option from user preference bzr revid: al@openerp.com-20120208135010-u6s6tl1loss9a74u --- openerp/addons/base/base_update.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/base_update.xml b/openerp/addons/base/base_update.xml index aa38561dacd..c5594f76e22 100644 --- a/openerp/addons/base/base_update.xml +++ b/openerp/addons/base/base_update.xml @@ -89,7 +89,7 @@ - + From 9cc531505f7a00083b32a91215dbef3213dc2a02 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 8 Feb 2012 14:56:55 +0100 Subject: [PATCH 003/210] [FIX] formatting of float_time fields lp bug: https://launchpad.net/bugs/928220 fixed bzr revid: xmo@openerp.com-20120208135655-79qnr5tl6admxr1e --- addons/web/static/src/js/formats.js | 7 ++++++- addons/web/static/test/formats.js | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index eb7d6c335ac..d35a28f36b7 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -101,7 +101,12 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) { formatted[0] = openerp.web.insert_thousand_seps(formatted[0]); return formatted.join(l10n.decimal_point); case 'float_time': - return _.str.sprintf("%02d:%02d", + var pattern = '%02d:%02d'; + if (value < 0) { + value = Math.abs(value); + pattern = '-' + pattern; + } + return _.str.sprintf(pattern, Math.floor(value), Math.round((value % 1) * 60)); case 'many2one': diff --git a/addons/web/static/test/formats.js b/addons/web/static/test/formats.js index 640eaaadca7..2e292af41c8 100644 --- a/addons/web/static/test/formats.js +++ b/addons/web/static/test/formats.js @@ -71,6 +71,15 @@ $(document).ready(function () { strictEqual( openerp.web.format_value(0.0085, {type:'float', widget:'float_time'}), '00:01'); + strictEqual( + openerp.web.format_value(-1.0, {type:'float', widget:'float_time'}), + '-01:00'); + strictEqual( + openerp.web.format_value(-0.9853, {type:'float', widget:'float_time'}), + '-00:59'); + strictEqual( + openerp.web.format_value(-0.0085, {type:'float', widget:'float_time'}), + '-00:01'); }); test("format_float", function () { var fl = 12.1234; From 5af49817f451584930b762ad6ccf7b572037fb07 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 8 Feb 2012 14:59:45 +0100 Subject: [PATCH 004/210] [FIX] allow text inside
- +
@@ -44,6 +44,12 @@
+ +
+ +
+
+
There are pending operations that could not be saved into the database, are you sure you want to exit?
@@ -531,30 +537,7 @@
-
-
-
- -
Help
-
-
-
-
- -
Close
-
-
-
-
- -
Client Mode
-
-
-
    -
From 7a1cee1401bf7c5ea97981a69b4f25a0601ba1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 20 Jul 2012 17:24:21 +0200 Subject: [PATCH 020/210] [IMP] point_of_sale: refactored the ean checksum method bzr revid: fva@openerp.com-20120720152421-lfq05r6xkczl1y56 --- addons/product/product.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 3cbff880cf9..c50ad3c27b9 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -30,15 +30,10 @@ from tools.translate import _ def is_pair(x): return not x%2 -def check_ean(eancode): - if not eancode: - return True +def ean_checksum(eancode): + """returns the checksum of an ean string of length 13, returns -1 if the string has the wrong length""" if len(eancode) <> 13: - return False - try: - int(eancode) - except: - return False + return -1 oddsum=0 evensum=0 total=0 @@ -54,10 +49,20 @@ def check_ean(eancode): total=(oddsum * 3) + evensum check = int(10 - math.ceil(total % 10.0)) %10 + return check - if check != int(eancode[-1]): +def check_ean(eancode): + """returns True if eancode is a valid ean13 string, or null""" + if not eancode: + return True + if len(eancode) <> 13: return False - return True + try: + int(eancode) + except: + return False + return ean_checksum(eancode) == int(eancode[-1]) + #---------------------------------------------------------- # UOM #---------------------------------------------------------- From f1fbf44b5c9ae1275c9fb9e6a5c1ef8e337742a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 20 Jul 2012 19:00:12 +0200 Subject: [PATCH 021/210] [WIP] point_of_sale: barcode validation wizard (wip) bzr revid: fva@openerp.com-20120720170012-eqp81clbpbfsr3hl --- addons/point_of_sale/point_of_sale.py | 38 ++++++++++++------ addons/point_of_sale/point_of_sale_view.xml | 44 +++++++++++++++------ addons/product/product.py | 13 ++++++ 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index ed3fa9c1730..d86d4c3d8ad 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -22,6 +22,7 @@ import pdb import io import openerp import addons +import openerp.addons.product.product import time from datetime import datetime @@ -143,8 +144,6 @@ class pos_config(osv.osv): obj.sequence_id.unlink() return super(pos_config, self).unlink(cr, uid, ids, context=context) -pos_config() - class pos_session(osv.osv): _name = 'pos.session' _order = 'id desc' @@ -425,8 +424,6 @@ class pos_session(osv.osv): 'context' : context, } -pos_session() - class pos_order(osv.osv): _name = "pos.order" _description = "Point of Sale" @@ -1038,8 +1035,6 @@ class pos_order(osv.osv): self.create_account_move(cr, uid, ids, context=context) return True -pos_order() - class account_bank_statement(osv.osv): _inherit = 'account.bank.statement' _columns= { @@ -1138,8 +1133,6 @@ class pos_order_line(osv.osv): }) return super(pos_order_line, self).copy_data(cr, uid, id, default, context=context) -pos_order_line() - class pos_category(osv.osv): _name = 'pos.category' _description = "Point of Sale Category" @@ -1211,12 +1204,24 @@ class pos_category(osv.osv): # 'category_image': _get_default_image, #} -pos_category() - import io, StringIO +class ean_wizard(osv.osv_memory): + _name = 'pos.ean_wizard' + _columns = { + 'ean13_pattern': fields.char('Ean13 Pattern', size=32, required=True, translate=True), + } + def sanitize_ean13(self, cr, uid, ids, context): + for r in self.browse(cr,uid,ids): + ean13 = openerp.addons.product.product.sanitize_ean13(r.ean13_pattern) + m = context.get('active_model') + m_id = context.get('active_id') + self.pool.get(m).write(cr,uid,[m_id],{'ean13':ean13}) + class product_product(osv.osv): _inherit = 'product.product' + + def _get_small_image(self, cr, uid, ids, prop, unknow_none, context=None): result = {} for obj in self.browse(cr, uid, ids, context=context): @@ -1247,7 +1252,16 @@ class product_product(osv.osv): 'to_weight' : False, } -product_product() - + def add_ean13(self, cr, uid, ids, context): + return { + 'name': _('Return Products'), + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'pos.ean_wizard', + 'target' : 'new', + 'view_id': False, + 'context':context, + } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index f3b491116b7..1145189b408 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -618,12 +618,22 @@ form - - - - - - + + + + + + + + + + + + + + + +
From 17768541a07ca47e6b7ae48dc0a5455ef0301d7f Mon Sep 17 00:00:00 2001 From: "Pinakin Nai(OpenERP)" <> Date: Wed, 22 Aug 2012 19:00:35 +0530 Subject: [PATCH 132/210] [IMP] Added new stlye to avoid overriding of text in header section bzr revid: pso@tinyerp.com-20120822133035-totgh1ez1omty11r --- addons/web/static/src/css/base.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index dca16278ffa..bd22cce70b2 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -153,6 +153,10 @@ list-style-type: disc; } + .openerp .oe_form_field_html h1,h2 { + line-height:26px; +} + .openerp input, .openerp textarea, .openerp select { padding: 2px 4px; border: 1px solid #cccccc; From 1dd5177e11ca6effd4d38fb4fb16326a33bbdbb8 Mon Sep 17 00:00:00 2001 From: "Dharti Ratani (OpenERP)" Date: Wed, 22 Aug 2012 19:04:28 +0530 Subject: [PATCH 133/210] [IMP] bzr revid: dhr@tinyerp.com-20120822133428-24wti3kz7lh469jh --- .../wizard/hr_timesheet_invoice_create.py | 5 ++++- addons/point_of_sale/point_of_sale.py | 5 ++++- addons/sale/sale.py | 5 ++++- addons/stock/stock.py | 11 +++++++++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 76314e1986a..f8c1c3d3149 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -115,7 +115,10 @@ class account_analytic_line(osv.osv): else: price = 0.0 - taxes = product.taxes_id + if product.taxes_id: + taxes = product.taxes_id + else: + taxes = product.categ_id.taxes_id tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes) account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id if not account_id: diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 690d371e9db..6871f072cfd 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1108,7 +1108,10 @@ class pos_order_line(osv.osv): account_tax_obj = self.pool.get('account.tax') cur_obj = self.pool.get('res.currency') for line in self.browse(cr, uid, ids, context=context): - taxes = line.product_id.taxes_id + if line.product_id.taxes_id: + taxes = line.product_id.taxes_id + else: + taxes = line.product_id.categ_id.taxes_id price = line.price_unit * (1 - (line.discount or 0.0) / 100.0) taxes = account_tax_obj.compute_all(cr, uid, line.product_id.taxes_id, price, line.qty, product=line.product_id, partner=line.order_id.partner_id or False) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c525ba04df1..ed5ac3d43f6 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1382,7 +1382,10 @@ class sale_order_line(osv.osv): fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False if update_tax: #The quantity only have changed result['delay'] = (product_obj.sale_delay or 0.0) - result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id) + if product_obj.taxes_id: + result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id) + else: + result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.categ_id.taxes_id) result.update({'type': product_obj.procure_method}) if not flag: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index b770712429c..7b65cc99847 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -915,9 +915,16 @@ class stock_picking(osv.osv): @return: Taxes Ids for the move line """ if type in ('in_invoice', 'in_refund'): - taxes = move_line.product_id.supplier_taxes_id + if product_id.supplier_taxes_id: + taxes = move_line.product_id.supplier_taxes_id + else: + taxes = move_line.product_id.categ_id.supplier_taxes_id else: - taxes = move_line.product_id.taxes_id + if product_id.taxes_id: + taxes = move_line.product_id.taxes_id + else: + taxes = move_line.product_id.categ_id.taxes_id + if move_line.picking_id and move_line.picking_id.partner_id and move_line.picking_id.partner_id.id: return self.pool.get('account.fiscal.position').map_tax( From 5d0b45b95846e3793136b4e60a0f077ce1561582 Mon Sep 17 00:00:00 2001 From: "Vidhin Mehta (OpenERP)" Date: Wed, 22 Aug 2012 19:12:49 +0530 Subject: [PATCH 135/210] [FIX]get all span text of header. bzr revid: vme@tinyerp.com-20120822134249-e398qom83ur322ub --- addons/board/static/src/js/dashboard.js | 2 +- addons/board/static/src/xml/board.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index 02f6afba442..c1561ac6e16 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -27,7 +27,7 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ // 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:first').click(function(ev){ + 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()); }); diff --git a/addons/board/static/src/xml/board.xml b/addons/board/static/src/xml/board.xml index caa20ce8a3f..63abebf4bc6 100644 --- a/addons/board/static/src/xml/board.xml +++ b/addons/board/static/src/xml/board.xml @@ -23,7 +23,7 @@

- + &nbsp; From 60d23d96cd4f798e90dfcac99867a3fa241a1268 Mon Sep 17 00:00:00 2001 From: "Vidhin Mehta (OpenERP)" Date: Wed, 22 Aug 2012 19:14:30 +0530 Subject: [PATCH 136/210] [FIX] remove . bzr revid: vme@tinyerp.com-20120822134430-5493lvfv98c3lhy6 --- addons/board/static/src/xml/board.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/board/static/src/xml/board.xml b/addons/board/static/src/xml/board.xml index 63abebf4bc6..b2363cafd53 100644 --- a/addons/board/static/src/xml/board.xml +++ b/addons/board/static/src/xml/board.xml @@ -23,7 +23,7 @@

- + &nbsp; From 079b425d1108bae2e5b583ed6f3b9bcfc299141e Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 22 Aug 2012 15:48:20 +0200 Subject: [PATCH 137/210] [FIX] tests: allow running the tests when installing a database created by XML-RPC. bzr revid: vmt@openerp.com-20120822134820-pevo06jwrhm8unui --- openerp/tests/common.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openerp/tests/common.py b/openerp/tests/common.py index b1af4338312..53c67c68844 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import os +import threading import time import unittest2 import xmlrpclib @@ -11,6 +12,13 @@ ADDONS_PATH = openerp.tools.config['addons_path'] PORT = openerp.tools.config['xmlrpc_port'] DB = openerp.tools.config['db_name'] +# If the database name is not provided on the command-line, +# use the one on the thread (which means if it is provided on +# the command-line, this will break when installing another +# database from XML-RPC). +if not DB and hasattr(threading.current_thread(), 'dbname'): + DB = threading.current_thread().dbname + HOST = '127.0.0.1' ADMIN_USER = 'admin' From d8c0fdf505395f191532d2d133d114d6838d19bc Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Wed, 22 Aug 2012 16:36:42 +0200 Subject: [PATCH 138/210] [FIX] base: remove the sequence field in a view bzr revid: stw@openerp.com-20120822143642-3esq9y0wh7zqt9es --- openerp/addons/base/ir/ir.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/openerp/addons/base/ir/ir.xml b/openerp/addons/base/ir/ir.xml index fac2946e204..49bb719bad7 100644 --- a/openerp/addons/base/ir/ir.xml +++ b/openerp/addons/base/ir/ir.xml @@ -560,7 +560,6 @@ ir.needaction_users_rel.tree ir.needaction_users_rel - 10 From 68e75403309b121cfafd7ffbbc2bb6aac0f221ab Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 22 Aug 2012 16:43:29 +0200 Subject: [PATCH 139/210] [IMP] simplify menuitems refering to actions others than act_window also remove project_timesheet_data.xml which content was entirely commented bzr revid: abo@openerp.com-20120822144329-dk3y3e3z4k2pdd3l --- .../account_accountant_data.xml | 12 +++++------ .../hr_timesheet_sheet_data.xml | 11 +++------- addons/mail/mail_thread_view.xml | 16 +++------------ addons/project_timesheet/__openerp__.py | 17 ++++++++-------- .../project_timesheet_data.xml | 20 ------------------- 5 files changed, 19 insertions(+), 57 deletions(-) delete mode 100644 addons/project_timesheet/project_timesheet_data.xml diff --git a/addons/account_accountant/account_accountant_data.xml b/addons/account_accountant/account_accountant_data.xml index 57fb229ad12..383b53cf49e 100644 --- a/addons/account_accountant/account_accountant_data.xml +++ b/addons/account_accountant/account_accountant_data.xml @@ -1,10 +1,10 @@ - - - Accounting - + + + @@ -19,10 +19,8 @@ automatic 100 - - - + diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_data.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_data.xml index f9c9070ddbf..5458f397e36 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_data.xml +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_data.xml @@ -1,7 +1,8 @@ - + + @@ -20,13 +21,7 @@ - - My Current Timesheet - - - STOCK_JUSTIFY_FILL - - + diff --git a/addons/mail/mail_thread_view.xml b/addons/mail/mail_thread_view.xml index 68727832e53..f6ef5bc2ee9 100644 --- a/addons/mail/mail_thread_view.xml +++ b/addons/mail/mail_thread_view.xml @@ -8,21 +8,11 @@ groups="base.group_user" sequence="10"/> - + - - News Feed - - - - - - My Feeds - - - - + + diff --git a/addons/project_timesheet/__openerp__.py b/addons/project_timesheet/__openerp__.py index a55f67bda2c..8770aa53429 100644 --- a/addons/project_timesheet/__openerp__.py +++ b/addons/project_timesheet/__openerp__.py @@ -35,15 +35,14 @@ with the effect of creating, editing and deleting either ways. 'website': 'http://www.openerp.com', 'images': ['images/invoice_task_work.jpeg', 'images/my_timesheet.jpeg', 'images/working_hour.jpeg'], 'depends': ['project', 'hr_timesheet_sheet', 'hr_timesheet_invoice', 'account_analytic_analysis'], - 'init_xml': ['project_timesheet_data.xml'], - 'update_xml': [ - "security/ir.model.access.csv", - "security/project_timesheet_security.xml", - "process/project_timesheet_process.xml", - "report/task_report_view.xml", - "project_timesheet_view.xml", - ], - 'demo_xml': ["project_timesheet_demo.xml"], + 'data': [ + 'security/ir.model.access.csv', + 'security/project_timesheet_security.xml', + 'process/project_timesheet_process.xml', + 'report/task_report_view.xml', + 'project_timesheet_view.xml', + ], + 'demo': ['project_timesheet_demo.xml'], 'test': [ 'test/worktask_entry_to_timesheetline_entry.yml', 'test/work_timesheet.yml', diff --git a/addons/project_timesheet/project_timesheet_data.xml b/addons/project_timesheet/project_timesheet_data.xml deleted file mode 100644 index ed87cb8c65f..00000000000 --- a/addons/project_timesheet/project_timesheet_data.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - From 818c9dd2b12377e02ebe43eb20757f3bfabfd367 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 22 Aug 2012 16:44:12 +0200 Subject: [PATCH 140/210] [IMP] indentation bzr revid: abo@openerp.com-20120822144412-6lnbo1n5jdv32vb4 --- addons/crm/crm_meeting_view.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index d7f59267a30..068f7cfbf64 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -2,9 +2,8 @@ - - - + + calendar.attendee.form.inherit calendar.attendee @@ -13,7 +12,7 @@ - + From a337ca201d7d72b485c0e330c433afc50bef458a Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 22 Aug 2012 16:49:46 +0200 Subject: [PATCH 141/210] [IMP] rng: forbid redundant @type for menuitem, now inferred from the action type + minor cleanup bzr revid: odo@openerp.com-20120822144946-fdsw9ee1ia3nfe86 --- openerp/import_xml.rng | 1 - openerp/tools/convert.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openerp/import_xml.rng b/openerp/import_xml.rng index bf5a9e1800e..5dd789c6e95 100644 --- a/openerp/import_xml.rng +++ b/openerp/import_xml.rng @@ -185,7 +185,6 @@ - diff --git a/openerp/tools/convert.py b/openerp/tools/convert.py index 5fd88889602..8269fa5d7ff 100644 --- a/openerp/tools/convert.py +++ b/openerp/tools/convert.py @@ -593,11 +593,11 @@ form: module.record_id""" % (xml_id,) a_action = rec.get('action','').encode('utf8') # determine the type of action - if ('.' in a_action): - # this is an action refering to another module: extract this module's name + if '.' in a_action: + # action referring to another module a_action_module, a_action_name = a_action.split('.') else: - # this is a local action: fetch the current module's name + # local action: use current module a_action_module = self.module a_action_name = a_action From 31c6018909f25aa0c029e3f7bd41139a3280d415 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 22 Aug 2012 18:32:37 +0200 Subject: [PATCH 142/210] [IMP] remove unused dummy() method bzr revid: abo@openerp.com-20120822163237-ujifdtucyl18w9ze --- addons/project/project.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 1a8f8c8bfe5..ab1c3c47dfe 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -250,9 +250,6 @@ class project(osv.osv): type='many2many', relation='res.users', string='Followers'), } - def dummy(self, cr, uid, ids, context): - return True - def _get_type_common(self, cr, uid, context): ids = self.pool.get('project.task.type').search(cr, uid, [('case_default','=',1)], context=context) return ids @@ -526,7 +523,7 @@ def Project(): mail_alias = self.pool.get('mail.alias') if not vals.get('alias_id'): vals.pop('alias_name', None) # prevent errors during copy() - alias_id = mail_alias.create_unique_alias(cr, uid, + alias_id = mail_alias.create_unique_alias(cr, uid, # Using '+' allows using subaddressing for those who don't # have a catchall domain setup. {'alias_name': "project+"+short_name(vals['name'])}, From 0b29e7579d0f42bf0e6f74b16edf53845f417c53 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 22 Aug 2012 19:46:35 +0200 Subject: [PATCH 143/210] [IMP] avoid re-computing the module's field by setting it to bzr revid: abo@openerp.com-20120822174635-agqupq0iyqc0rn9v --- openerp/addons/base/module/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index c5df273ea02..d523ff0ac7f 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -192,7 +192,7 @@ class module(osv.osv): 'category_id': fields.many2one('ir.module.category', 'Category', readonly=True, select=True), 'shortdesc': fields.char('Module Name', size=64, readonly=True, translate=True), 'summary': fields.char('Summary', size=64, readonly=True, translate=True), - 'description': fields.function(_get_desc, string='Description', type='html', method=True, readonly=True), + 'description': fields.function(_get_desc, string='Description', type='html', method=True, readonly=True, store=True), 'author': fields.char("Author", size=128, readonly=True), 'maintainer': fields.char('Maintainer', size=128, readonly=True), 'contributors': fields.text('Contributors', readonly=True), From 73025425f065cb82bb171d5dd09f2569577727a0 Mon Sep 17 00:00:00 2001 From: "Dharti Ratani (OpenERP)" Date: Thu, 23 Aug 2012 10:41:20 +0530 Subject: [PATCH 144/210] [IMP]Tax related changes in mrp and pos bzr revid: dhr@tinyerp.com-20120823051120-en7wvauuwgop2w26 --- addons/mrp_repair/mrp_repair.py | 5 ++++- addons/point_of_sale/point_of_sale.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index f41abb58c08..c099679b87a 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -634,7 +634,10 @@ class ProductChangeMixin(object): product_obj = self.pool.get('product.product').browse(cr, uid, product) if partner_id: partner = self.pool.get('res.partner').browse(cr, uid, partner_id) - result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.taxes_id) + if product_obj.taxes_id: + result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.taxes_id) + else: + result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.categ_id.taxes_id) result['name'] = product_obj.partner_ref result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 6871f072cfd..302c3a2cb71 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -967,7 +967,10 @@ class pos_order(osv.osv): for line in order.lines: tax_amount = 0 - taxes = [t for t in line.product_id.taxes_id] + if line.product_id.taxes_id: + taxes = [t for t in line.product_id.taxes_id] + else: + taxes = [t for t in line.product_id.categ_id.taxes_id] computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit * (100.0-line.discount) / 100.0, line.qty)['taxes'] for tax in computed_taxes: From cece6655af45886898f10a85154df060b9ef30b5 Mon Sep 17 00:00:00 2001 From: "Vidhin Mehta (OpenERP)" Date: Thu, 23 Aug 2012 11:40:22 +0530 Subject: [PATCH 145/210] [IMP]make changes in ir act window's name. bzr revid: vme@tinyerp.com-20120823061022-fti5xixis5ffak1k --- addons/board/static/src/js/dashboard.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index c1561ac6e16..54fda76e2b4 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -54,11 +54,17 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ 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 ir_act_window = new instance.web.Model("ir.actions.act_window"); var change_string = function(new_name){ attr['string'] = new_name; - span.text(new_name).show(); - input.css('visibility','hidden'); - self.do_save_dashboard(); + ir_act_window.call("write",[[parseInt(attr['name'])],{'name':new_name}]) + .done(function(res){ + if(!res)return; + span.text(new_name).show(); + input.css('visibility','hidden'); + self.do_save_dashboard(); + }) + } input.unbind() .val(span.text()) From 39ac8404ffa3ae437c6544247af8916e8c8d8af3 Mon Sep 17 00:00:00 2001 From: "Dharti Ratani (OpenERP)" Date: Thu, 23 Aug 2012 12:40:44 +0530 Subject: [PATCH 146/210] [IMP]Tax fix related to stock and pos bzr revid: dhr@tinyerp.com-20120823071044-aonyui4dq2li8xnj --- addons/point_of_sale/point_of_sale.py | 11 +++++------ addons/stock/stock.py | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 302c3a2cb71..fd9ce12251a 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -967,10 +967,7 @@ class pos_order(osv.osv): for line in order.lines: tax_amount = 0 - if line.product_id.taxes_id: - taxes = [t for t in line.product_id.taxes_id] - else: - taxes = [t for t in line.product_id.categ_id.taxes_id] + taxes = [t for t in line.product_id.taxes_id] computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit * (100.0-line.discount) / 100.0, line.qty)['taxes'] for tax in computed_taxes: @@ -1147,8 +1144,10 @@ class pos_order_line(osv.osv): cur_obj = self.pool.get('res.currency') prod = self.pool.get('product.product').browse(cr, uid, product, context=context) - - taxes = prod.taxes_id + if prod.taxes_id: + taxes = prod.taxes_id + else: + taxes = prod.categ_id.taxes_id price = price_unit * (1 - (discount or 0.0) / 100.0) taxes = account_tax_obj.compute_all(cr, uid, prod.taxes_id, price, qty, product=prod, partner=False) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7b65cc99847..36538175e27 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -915,12 +915,12 @@ class stock_picking(osv.osv): @return: Taxes Ids for the move line """ if type in ('in_invoice', 'in_refund'): - if product_id.supplier_taxes_id: + if move_line.product_id.supplier_taxes_id: taxes = move_line.product_id.supplier_taxes_id else: taxes = move_line.product_id.categ_id.supplier_taxes_id else: - if product_id.taxes_id: + if move_line.product_id.taxes_id: taxes = move_line.product_id.taxes_id else: taxes = move_line.product_id.categ_id.taxes_id From 77bbe04bfc88b1500d6fdd2f81f8defef8471bcc Mon Sep 17 00:00:00 2001 From: "Jiten (OpenERP)" Date: Thu, 23 Aug 2012 12:50:10 +0530 Subject: [PATCH 147/210] [REV] Revert last changes. bzr revid: jra@tinyerp.com-20120823072010-wsx6sgy02luxa2wo --- addons/board/static/src/js/dashboard.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index 54fda76e2b4..c1561ac6e16 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -54,17 +54,11 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ 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 ir_act_window = new instance.web.Model("ir.actions.act_window"); var change_string = function(new_name){ attr['string'] = new_name; - ir_act_window.call("write",[[parseInt(attr['name'])],{'name':new_name}]) - .done(function(res){ - if(!res)return; - span.text(new_name).show(); - input.css('visibility','hidden'); - self.do_save_dashboard(); - }) - + span.text(new_name).show(); + input.css('visibility','hidden'); + self.do_save_dashboard(); } input.unbind() .val(span.text()) From e82f52926c85a709245a90cb9f387abe07a3484a Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Thu, 23 Aug 2012 10:35:05 +0200 Subject: [PATCH 148/210] [FIX] setup.py: added docutils dependency introduced at revision 4341.3.1. bzr revid: vmt@openerp.com-20120823083505-evk7pw3drx28rj1z --- openerp/addons/base/module/module.py | 5 +++-- setup.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index d523ff0ac7f..d64a754c5a2 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -18,18 +18,19 @@ # along with this program. If not, see . # ############################################################################## + +import base64 +from docutils.core import publish_string import imp import logging import re import urllib import zipimport -import base64 from openerp import modules, pooler, release, tools, addons from openerp.tools.parse_version import parse_version from openerp.tools.translate import _ from openerp.osv import fields, osv, orm -from docutils.core import publish_string _logger = logging.getLogger(__name__) diff --git a/setup.py b/setup.py index 6e1adadde82..5925a0484ba 100755 --- a/setup.py +++ b/setup.py @@ -96,6 +96,7 @@ setuptools.setup( # our tree.) http://download.gna.org/pychart/ # TODO 'pychart', 'babel', + 'docutils', 'feedparser', 'gdata', 'lxml', From 7fe9ca1ed6d8017b4fb0cdb6b50fe15b0ae5aaef Mon Sep 17 00:00:00 2001 From: "Bharat Devnani(OpenERP)" <> Date: Thu, 23 Aug 2012 14:21:30 +0530 Subject: [PATCH 149/210] [IMP] Added label for sale order line selection on create invoice wizard bzr revid: pso@tinyerp.com-20120823085130-eczt22j1oozyni7v --- addons/sale/wizard/sale_make_invoice_advance.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/wizard/sale_make_invoice_advance.xml b/addons/sale/wizard/sale_make_invoice_advance.xml index 5bb7d231e94..eceaadc89d0 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.xml +++ b/addons/sale/wizard/sale_make_invoice_advance.xml @@ -23,6 +23,7 @@

+

\ 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 + + +
+
+
+

+ 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 + + + + + From ebb3df4f8cd4711809763530545e1236eae16a16 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 23 Aug 2012 12:02:52 +0200 Subject: [PATCH 152/210] [FIX] convert: fix previous partial fix for removing redundant @type for bzr revid: odo@openerp.com-20120823100252-zmhpaocb2bb11c99 --- openerp/tools/convert.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/openerp/tools/convert.py b/openerp/tools/convert.py index 8269fa5d7ff..cee414c2825 100644 --- a/openerp/tools/convert.py +++ b/openerp/tools/convert.py @@ -593,18 +593,8 @@ form: module.record_id""" % (xml_id,) a_action = rec.get('action','').encode('utf8') # determine the type of action - if '.' in a_action: - # action referring to another module - a_action_module, a_action_name = a_action.split('.') - else: - # local action: use current module - a_action_module = self.module - a_action_name = a_action - - # fetch the model and the res id - ir_action_ref = self.pool.get('ir.model.data').get_object_reference(cr, self.uid, a_action_module, a_action_name) - # get the part of the model we need - a_type = ir_action_ref[0].split('.')[-1] + a_type, a_id = self.model_id_get(a_action) + a_type = a_type.split('.')[-1] # keep only type part icons = { "act_window": 'STOCK_NEW', @@ -617,7 +607,6 @@ form: module.record_id""" % (xml_id,) values['icon'] = icons.get(a_type,'STOCK_NEW') if a_type=='act_window': - a_id = self.id_get(cr, a_action) cr.execute('select view_type,view_mode,name,view_id,target from ir_act_window where id=%s', (int(a_id),)) rrres = cr.fetchone() assert rrres, "No window action defined for this id %s !\n" \ @@ -644,7 +633,6 @@ form: module.record_id""" % (xml_id,) values['name'] = action_name elif a_type in ['wizard', 'url', 'client', 'server'] and not values.get('name'): - a_id = self.id_get(cr, a_action) a_table = 'ir_act_%s' % a_type cr.execute('select name from %s where id=%%s' % a_table, (int(a_id),)) resw = cr.fetchone() @@ -682,9 +670,6 @@ form: module.record_id""" % (xml_id,) self.idref[rec_id] = int(pid) if rec.get('action') and pid: - a_action = rec.get('action').encode('utf8') - a_type = rec.get('type','').encode('utf8') or 'act_window' - a_id = self.id_get(cr, a_action) action = "ir.actions.%s,%d" % (a_type, a_id) self.pool.get('ir.model.data').ir_set(cr, self.uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(pid))], action, True, True, xml_id=rec_id) return ('ir.ui.menu', pid) From 7ddc6a2cd9b6d614fe007d73b95804dfd7d9fdc8 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 23 Aug 2012 12:05:04 +0200 Subject: [PATCH 153/210] [FIX] convert: fix previous partial patch for removing redundant @type for bzr revid: odo@openerp.com-20120823100504-q8w91ga5wbot20o5 --- openerp/tools/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/tools/convert.py b/openerp/tools/convert.py index cee414c2825..be8465055ee 100644 --- a/openerp/tools/convert.py +++ b/openerp/tools/convert.py @@ -593,7 +593,7 @@ form: module.record_id""" % (xml_id,) a_action = rec.get('action','').encode('utf8') # determine the type of action - a_type, a_id = self.model_id_get(a_action) + a_type, a_id = self.model_id_get(cr, a_action) a_type = a_type.split('.')[-1] # keep only type part icons = { From a732d1cdc5f8e5dc59e44f50ea73d57c8d4869e7 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 23 Aug 2012 12:16:01 +0200 Subject: [PATCH 154/210] [FIX] problem with set defaults bzr revid: nicolas.vanhoren@openerp.com-20120823101601-mnknsr54dhv1lv83 --- addons/web/static/src/js/view_form.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index bad2f843fc6..fe53705510b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -960,15 +960,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM return false; } var displayed = value; - switch (field.field.type) { - case 'selection': + if (field instanceof instance.web.form.FieldSelection) { displayed = _(field.values).find(function (option) { return option[0] === value; })[1]; - break; - case 'many2one': + } else if (field instanceof instance.web.form.FieldMany2One) { displayed = field.get_displayed(); - break; } return { @@ -4738,14 +4735,12 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ // statusbar_visible attribute of the field. For example: // statusbar_visible="draft,open". var selection = this.field.selection; - console.log(selection); for(var i=0; i< selection.length; i++) { var key = selection[i][0]; if(key == this.selected_value || !this.options.visible || this.options.visible.indexOf(key) != -1) { this.selection.push(selection[i]); } } - console.log(this.selection); this.render_elements(); } }, From d48ff4be8fe7144258961efc5fd51a5578627e62 Mon Sep 17 00:00:00 2001 From: "Bharat Devnani(OpenERP)" <> Date: Thu, 23 Aug 2012 15:49:17 +0530 Subject: [PATCH 155/210] [IMP] Added label for sale order line selection on create invoice wizard bzr revid: pso@tinyerp.com-20120823101917-8r8mvog04xsjq0cg --- addons/sale/wizard/sale_make_invoice_advance.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/sale/wizard/sale_make_invoice_advance.xml b/addons/sale/wizard/sale_make_invoice_advance.xml index eceaadc89d0..97e9c843683 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.xml +++ b/addons/sale/wizard/sale_make_invoice_advance.xml @@ -22,8 +22,10 @@ attrs="{'invisible': [('advance_payment_method', '!=', 'percentage')]}"/> +
+ +