From a2b23a1ca71a25f912c5f92e8a1dbfdde69bc568 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 29 Nov 2012 12:23:50 +0100 Subject: [PATCH 1/6] [REM] merge conflict file committed bzr revid: xmo@openerp.com-20121129112350-egvxrg8ii71wzdx6 --- addons/web/static/test/test.html.THIS | 63 --------------------------- 1 file changed, 63 deletions(-) delete mode 100644 addons/web/static/test/test.html.THIS diff --git a/addons/web/static/test/test.html.THIS b/addons/web/static/test/test.html.THIS deleted file mode 100644 index f5f29f88d7c..00000000000 --- a/addons/web/static/test/test.html.THIS +++ /dev/null @@ -1,63 +0,0 @@ - - - - - OpenERP Web Test Suite - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - From fe3d493cc84583fbdd8da4917f9199fdef751dc0 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 29 Nov 2012 12:24:13 +0100 Subject: [PATCH 2/6] [FIX] searches with filters using "empty" domain/context values (but not attributes) e.g. @domain="[]" would be seen as non-empty by the search view, and if multiple domains the search view would generate a nonliteral ``['|', '[]', '[]]`` which would just yield ``['|']`` after evaluation and concatenation, which is an invalid domain and would blow up the server. Specifically filter out the values ``[]`` and ``{}`` from filters bzr revid: xmo@openerp.com-20121129112413-yrgncnesqs093jwf --- addons/web/static/src/js/search.js | 3 +++ addons/web/static/test/search.js | 36 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 5b59c7d6912..3917f342391 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1009,6 +1009,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in get_context: function (facet) { var contexts = facet.values.chain() .map(function (f) { return f.get('value').attrs.context; }) + .without('{}') .reject(_.isEmpty) .value(); @@ -1027,6 +1028,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in get_groupby: function (facet) { return facet.values.chain() .map(function (f) { return f.get('value').attrs.context; }) + .without('{}') .reject(_.isEmpty) .value(); }, @@ -1039,6 +1041,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in get_domain: function (facet) { var domains = facet.values.chain() .map(function (f) { return f.get('value').attrs.domain; }) + .without('[]') .reject(_.isEmpty) .value(); diff --git a/addons/web/static/test/search.js b/addons/web/static/test/search.js index 45f6d2c715b..db9e7aa3ed9 100644 --- a/addons/web/static/test/search.js +++ b/addons/web/static/test/search.js @@ -845,6 +845,42 @@ openerp.testing.section('search-serialization', { ok(!context.get_eval_context(), "context should have no evaluation context"); }); }); + test('Empty filter domains', {asserts: 4}, function (instance) { + var view = {inputs: [], query: {on: function () {}}}; + var filter_a = new instance.web.search.Filter( + {attrs: {name: 'a', context: '{}', domain: '[]'}}, view); + var filter_b = new instance.web.search.Filter( + {attrs: {name: 'b', context: '{}', domain: '[]'}}, view); + var filter_c = new instance.web.search.Filter( + {attrs: {name: 'c', context: '{b: 42}', domain: '[["a", "=", 3]]'}}, view); + var group = new instance.web.search.FilterGroup( + [filter_a, filter_b, filter_c], view); + var t1 = group.facet_for_defaults({a: true, c: true}) + .done(function (facet) { + var model = facet; + if (!(model instanceof instance.web.search.Facet)) { + model = new instance.web.search.Facet(facet); + } + + var domain = group.get_domain(model); + deepEqual(domain, '[["a", "=", 3]]', "domain should ignore empties"); + var context = group.get_context(model); + deepEqual(context, '{b: 42}', "context should ignore empties"); + }); + var t2 = group.facet_for_defaults({a: true, b: true}) + .done(function (facet) { + var model = facet; + if (!(model instanceof instance.web.search.Facet)) { + model = new instance.web.search.Facet(facet); + } + + var domain = group.get_domain(model); + equal(domain, null, "domain should ignore empties"); + var context = group.get_context(model); + equal(context, null, "context should ignore empties"); + }); + return $.when(t1, t2); + }); }); openerp.testing.section('removal', { dependencies: ['web.search'], From 93eddbd4a8e60522c209761da08b7b4d200e7f00 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 29 Nov 2012 12:27:37 +0100 Subject: [PATCH 3/6] [IMP] fixes for kanban column visible in tasks & issues bzr revid: fp@tinyerp.com-20121129112737-w3h80e7nbxs0l5lp --- addons/project/project.py | 14 +++----------- addons/project_issue/project_issue.py | 8 +++----- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 68122d1a614..c6577b00e6a 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -603,18 +603,13 @@ class task(base_stage, osv.osv): stage_obj = self.pool.get('project.task.type') order = stage_obj._order access_rights_uid = access_rights_uid or uid - # lame way to allow reverting search, should just work in the trivial case if read_group_order == 'stage_id desc': order = '%s desc' % order - # retrieve section_id from the context and write the domain - # - ('id', 'in', 'ids'): add columns that should be present - # - OR ('case_default', '=', True), ('fold', '=', False): add default columns that are not folded - # - OR ('project_ids', 'in', project_id), ('fold', '=', False) if project_id: add project columns that are not folded search_domain = [] project_id = self._resolve_project_id_from_context(cr, uid, context=context) if project_id: search_domain += ['|', ('project_ids', '=', project_id)] - search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)] + search_domain += [('id', 'in', ids)] stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context) result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context) # restore order of the search @@ -750,7 +745,7 @@ class task(base_stage, osv.osv): 'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority', select=True), 'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of tasks."), 'stage_id': fields.many2one('project.task.type', 'Stage', - domain="['&', ('fold', '=', False), '|', ('project_ids', '=', project_id), ('case_default', '=', True)]"), + domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"), 'state': fields.related('stage_id', 'state', type="selection", store=True, selection=_TASK_STATE, string="Status", readonly=True, help='The status is set to \'Draft\', when a case is created.\ @@ -936,14 +931,11 @@ class task(base_stage, osv.osv): for task in cases: if task.project_id: section_ids.append(task.project_id.id) - # OR all section_ids and OR with case_default search_domain = [] if section_ids: - search_domain += [('|')] * len(section_ids) + search_domain = [('|')] * (len(section_ids)-1) for section_id in section_ids: search_domain.append(('project_ids', '=', section_id)) - search_domain.append(('case_default', '=', True)) - # AND with the domain in parameter search_domain += list(domain) # perform search, return the first found stage_ids = self.pool.get('project.task.type').search(cr, uid, search_domain, order=order, context=context) diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 90640363906..fe5ce9f325b 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -89,7 +89,7 @@ class project_issue(base_stage, osv.osv): project_id = self._resolve_project_id_from_context(cr, uid, context=context) if project_id: search_domain += ['|', ('project_ids', '=', project_id)] - search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)] + search_domain += [('id', 'in', ids)] # perform search stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context) result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context) @@ -244,7 +244,7 @@ class project_issue(base_stage, osv.osv): 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'version_id': fields.many2one('project.issue.version', 'Version'), 'stage_id': fields.many2one ('project.task.type', 'Stage', - domain="['&', ('fold', '=', False), '|', ('project_ids', '=', project_id), ('case_default', '=', True)]"), + domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"), 'project_id':fields.many2one('project.project', 'Project'), 'duration': fields.float('Duration'), 'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"), @@ -442,11 +442,9 @@ class project_issue(base_stage, osv.osv): # OR all section_ids and OR with case_default search_domain = [] if section_ids: - search_domain += [('|')] * len(section_ids) + search_domain += [('|')] * (len(section_ids)-1) for section_id in section_ids: search_domain.append(('project_ids', '=', section_id)) - search_domain.append(('case_default', '=', True)) - # AND with the domain in parameter search_domain += list(domain) # perform search, return the first found stage_ids = self.pool.get('project.task.type').search(cr, uid, search_domain, order=order, context=context) From 7bfab22e1f6699890d79512f2b7f8ac486fa52f0 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 29 Nov 2012 13:07:38 +0100 Subject: [PATCH 4/6] [FIX] Propagate context to kanban's add_group() action bzr revid: fme@openerp.com-20121129120738-fgulo5hqib2uqeqa --- addons/web_kanban/static/src/js/kanban.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 4e9157e1d75..4eabcf0533b 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -190,6 +190,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ views: [[false, 'form']], type: 'ir.actions.act_window', target: "new", + context: self.dataset.get_context(), flags: { action_buttons: true, } From bd61641572949ab2c9b1a07267cd7d7344d17a7d Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 29 Nov 2012 14:06:55 +0100 Subject: [PATCH 5/6] [FIX] project issue bzr revid: fp@tinyerp.com-20121129130655-rm5hrk8m7tsy8g4v --- addons/project/project.py | 6 ++++++ addons/project/project_demo.xml | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index c6577b00e6a..b7c88f3532b 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -49,11 +49,17 @@ class project_task_type(osv.osv): 'fold': fields.boolean('Hide in views if empty', help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), } + def _get_default_project_id(self, cr, uid, ctx={}): + proj = ctx.get('default_project_id', False) + if type(proj) is int: + return [proj] + return proj _defaults = { 'sequence': 1, 'state': 'open', 'fold': False, 'case_default': True, + 'project_ids': _get_default_project_id } _order = 'sequence' diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml index ee887c2728c..d2bf7d0a2df 100644 --- a/addons/project/project_demo.xml +++ b/addons/project/project_demo.xml @@ -36,6 +36,10 @@ Implement new website for Sale and Warehouse Management for a customer. project.task + + + + @@ -45,6 +49,10 @@ public project.task + + + + @@ -58,6 +66,9 @@ + + + @@ -67,24 +78,30 @@ Website Design Templates project.task - + + + + 2 Data Import/Export Plugin project.task - + + + + From 40042cec1b3878809969dd51aa2abe498d701830 Mon Sep 17 00:00:00 2001 From: "dle@openerp.com" <> Date: Thu, 29 Nov 2012 15:18:54 +0100 Subject: [PATCH 6/6] [MERGE]trunk bzr revid: dle@openerp.com-20121129141854-2o6o44jhrpi54ssp --- addons/account/account_view.xml | 634 +++++++++++++++++++++++--------- 1 file changed, 450 insertions(+), 184 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 6f099e4b824..7732d8d8cb0 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2,7 +2,10 @@ - + + account.fiscalyear.form account.fiscalyear @@ -67,7 +70,7 @@ - + Fiscal Years account.fiscalyear form @@ -87,9 +90,12 @@ - + + + - account.period.form account.period @@ -136,6 +142,7 @@ + account.period.search account.period @@ -146,7 +153,8 @@ - + + Periods account.period form @@ -161,9 +169,12 @@

- + - + + account.account.form account.account @@ -204,6 +215,25 @@
+ + + account.account.search + account.account + + + + + + + + + + + + + + + account.account.list account.account @@ -223,23 +253,6 @@ - - account.account.search - account.account - - - - - - - - - - - - - - Accounts account.account @@ -263,20 +276,6 @@ - - - - account.account.tree account.account @@ -302,6 +301,7 @@ [('parent_id','=',False)] + Unrealized Gain or Loss account.account @@ -321,6 +321,7 @@ + Unrealized Gain or Loss account.account @@ -340,6 +341,7 @@

+ + + + + account.journal.column.form + account.journal.column + +
+ + + + + +
+ + account.journal.column.tree + account.journal.column + + + + + + + + + + account.journal.view.search + account.journal.view + + + + + + + + account.journal.view.tree + account.journal.view + + + + + + + + account.journal.view.form + account.journal.view + +
+ + + + +
+ + Journal Views + account.journal.view + form + tree,form + + +

+ Click to specify lists of columns to display for a type of journal. +

+ Journal views determine the way you can record entries in + your journal. Select the fields you want to appear in a journal + and determine the sequence in which they will appear. +

+ On the journal definition form, you can select the view you + want to use to display journal items related to this journal. +

+
+
+ + + + - account.journal.tree account.journal @@ -380,6 +462,7 @@ + account.journal.form account.journal @@ -392,7 +475,7 @@ - + @@ -406,6 +489,7 @@ + @@ -445,6 +529,7 @@ + Journals account.journal @@ -465,21 +550,6 @@ - - - - - account.cash.statement.select account.bank.statement @@ -665,7 +735,9 @@ - + account.account.type.search account.account.type @@ -675,6 +747,7 @@ + account.account.type.tree account.account.type @@ -685,6 +758,7 @@ + account.account.type.form account.account.type @@ -724,8 +798,9 @@ - - + account.move.tree account.move @@ -743,7 +818,10 @@ - + + account.move.reconcile.form account.move.reconcile @@ -762,7 +840,9 @@ - + account.tax.code.search account.tax.code @@ -833,17 +913,13 @@

- - + + - - + account.tax.tree account.tax @@ -965,7 +1041,57 @@ - + + + + account.move.line + + + + + + + + + + + + + + + + + + + account.move.line.tree + account.move.line + + + + + + + + + + + + + + + + + + + + + + + + + account.move.line.form account.move.line @@ -1035,6 +1161,7 @@ + account.move.line.form2 account.move.line @@ -1082,37 +1209,7 @@ - - account.move.line.tree - account.move.line - - - - - - - - - - - - - - - - - - - - - - - - - - - + account.move.line.graph account.move.line @@ -1124,6 +1221,7 @@ + Journal Items account.move.line @@ -1153,15 +1251,17 @@ + - {'journal_type':'general'} Journal Items account.move.line - - tree_account_move_line_quickadd + form + tree,form + {} +

- Select the period and the journal you want to fill. + Click to register a new journal item.

This view can be used by accountants in order to quickly record entries in OpenERP. If you want to record a supplier invoice, @@ -1171,6 +1271,7 @@

+ - - account.move.line - - - - - - - - - - - - - - - - - - {'search_default_unreconciled': 1,'view_mode':True} - Journal Items to Reconcile + + Lines to reconcile account.move.line - - tree_account_reconciliation - -

- No journal items found. -

-
+ form + tree,form + [('account_id.reconcile', '=', True),('reconcile_id','=',False)] + + +
- - - + + Journal Items + account.move.line + form + tree,form + + + {'search_default_account_id': [active_id]} + + + + tree_but_open + account.account + Open Journal Items + + + + account.move.tree account.move @@ -1271,8 +1360,10 @@ + + on_change="onchange_line_id(line_id)" + context="{'balance': balance , 'journal': journal_id }">
@@ -1339,6 +1430,7 @@ + @@ -1363,6 +1455,7 @@
+ account.move.select account.move @@ -1387,6 +1480,7 @@ + Journal Entries account.move @@ -1408,6 +1502,7 @@

+ + + + Journal Items + account.move.line + form + tree,form + + + + + + tree + + + + + + form + + + + + {'search_default_unreconciled': 1,'view_mode':True} + Journal Items to Reconcile + account.move.line + + tree_account_reconciliation + +

+ No journal items found. +

+
+
+ + + + + + + + + - + + + account.journal.period.tree account.journal.period @@ -1458,7 +1620,10 @@ tree - + + account.model.line.tree account.model.line @@ -1475,6 +1640,8 @@ + + account.model.line.form account.model.line @@ -1494,6 +1661,7 @@ + account.model.form account.model @@ -1512,6 +1680,7 @@ + account.model.tree account.model @@ -1523,6 +1692,7 @@ + account.model.search account.model @@ -1551,7 +1721,10 @@ action="action_model_form" name="Models" id="menu_action_model_form" sequence="5" parent="account.menu_finance_recurrent_entries"/> - + + account.payment.term.line.tree account.payment.term.line @@ -1566,6 +1739,8 @@ + + account.payment.term.line.form account.payment.term.line @@ -1605,6 +1780,7 @@ + account.payment.term.search account.payment.term @@ -1615,6 +1791,7 @@ + account.payment.term.form account.payment.term @@ -1630,6 +1807,7 @@ + Payment Terms account.payment.term @@ -1640,7 +1818,10 @@ - + + account.subscription.line.form account.subscription.line @@ -1653,6 +1834,7 @@ + account.subscription.line.tree account.subscription.line @@ -1663,6 +1845,7 @@ + account.subscription.tree account.subscription @@ -1676,6 +1859,7 @@ + account.subscription.search account.subscription @@ -1693,6 +1877,7 @@ + account.subscription.form account.subscription @@ -1778,7 +1963,72 @@ - + + Journal Items + account.move.line + form + tree,form + [('account_id','child_of', [active_id]),('state','<>','draft')] + {'account_id':active_id} + + + + account.move.line.tax.tree + account.move.line + + + + + + + + + + + + + + + + + + + + + + Journal Items + account.move.line + form + tree,form + + [('tax_code_id','child_of',active_id),('state','<>','draft')] + + + tree_but_open + account.tax.code + Tax Details + + + + + + + + + + - + + + + Create Account + account.addtmpl.wizard + +
+
+
+ + + + +
+ + + account.account.template.form account.account.template @@ -1837,6 +2104,7 @@ + account.account.template.tree account.account.template @@ -1849,6 +2117,7 @@ + account.account.template.search account.account.template @@ -1867,6 +2136,7 @@ + Account Templates account.account.template @@ -1874,32 +2144,11 @@ tree,form + - - Create Account - account.addtmpl.wizard - -
-
-
- - - - -
- - - - + account.chart.template.form account.chart.template @@ -1972,9 +2221,11 @@ form tree,form + + account.tax.template.form account.tax.template @@ -2053,6 +2304,7 @@ + Tax Templates account.tax.template @@ -2060,6 +2312,7 @@ tree,form + @@ -2075,6 +2328,7 @@
+ account.tax.code.template.search account.tax.code.template @@ -2088,6 +2342,7 @@ + account.tax.code.template.form account.tax.code.template @@ -2104,6 +2359,7 @@ + Tax Code Templates account.tax.code.template @@ -2115,6 +2371,7 @@ + Set Your Accounting Options wizard.multi.charts.accounts @@ -2153,6 +2410,7 @@ + Set Your Accounting Options ir.actions.act_window @@ -2258,6 +2516,7 @@ + account.bank.statement.form account.bank.statement @@ -2390,7 +2649,6 @@

- tree @@ -2420,7 +2678,10 @@ parent="menu_finance_payables" action="base.action_partner_supplier_form" sequence="100"/> - + + account.financial.report.form account.financial.report @@ -2447,6 +2708,7 @@ + account.financial.report.tree account.financial.report @@ -2459,6 +2721,7 @@ + account.financial.report.search account.financial.report @@ -2474,6 +2737,7 @@ + Financial Reports ir.actions.act_window @@ -2483,6 +2747,7 @@ + @@ -2505,6 +2770,7 @@ [('parent_id','=',False)] +