-
- Journal :
-
- Period :
-
From 30ea1678309f9ee5f0c62c977634367209b5d881 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 19 Nov 2012 12:19:07 +0100
Subject: [PATCH 15/77] Select boxes disabled when editing : )
bzr revid: dle@openerp.com-20121119111907-x59ovkghvjpzh33n
---
.../src/js/account_move_line_quickadd.js | 28 +++++++++++++------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index d36565d2ecf..1cc8942cb72 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -99,17 +99,27 @@ openerp.account.quickadd = function (instance) {
var compoundContext = self.last_context;
return self.old_search(compoundDomain, compoundContext, self.last_group_by);
},
- /*_next: function (next_record, options) {
- next_record = next_record || 'succ';
+ start_edition: function (record, options) {
+ this.$el.parent().find('.oe_account_select_journal').attr('disabled', 'disabled');
+ this.$el.parent().find('.oe_account_select_period').attr('disabled', 'disabled');
+ return this._super.apply(this, arguments);
+ },
+ cancel_edition: function (force) {
+ this.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
+ this.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
+ return this._super.apply(this, arguments);
+ },
+ save_edition: function () {
+ var tmp = this._super.apply(this, arguments);
var self = this;
- return this.save_edition().then(function (saveInfo) {
- if (saveInfo.created || self.records.at(self.records.length-1).get("id") === saveInfo.record.get("id")) {
- return self.start_edition();
+ tmp.then(function (saveInfo){
+ console.log(saveInfo);
+ if (saveInfo) {
+ self.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
+ self.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
}
- var record = self.records[next_record](
- saveInfo.record, {wraparound: true});
- return self.start_edition(record, options);
});
- },*/
+ return tmp;
+ }
});
};
From d831d5bd7c2c4b3cdd39394d5d40cde29c8960f7 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 19 Nov 2012 13:32:54 +0100
Subject: [PATCH 16/77] [FIX]Select boxes disabled when editing : ) : Better
implement way
bzr revid: dle@openerp.com-20121119123254-9rb4uxr97ux5iatv
---
.../src/js/account_move_line_quickadd.js | 30 +++++--------------
1 file changed, 8 insertions(+), 22 deletions(-)
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 1cc8942cb72..5a66e311261 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -33,6 +33,14 @@ openerp.account.quickadd = function (instance) {
self.current_period = parseInt(this.value);
self.do_search(self.last_domain, self.last_context, self.last_group_by);
});
+ this.on('edit:after', this, function () {
+ self.$el.parent().find('.oe_account_select_journal').attr('disabled', 'disabled');
+ self.$el.parent().find('.oe_account_select_period').attr('disabled', 'disabled');
+ });
+ this.on('save:after cancel:after', this, function () {
+ self.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
+ self.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
+ });
return tmp;
},
do_search: function(domain, context, group_by) {
@@ -99,27 +107,5 @@ openerp.account.quickadd = function (instance) {
var compoundContext = self.last_context;
return self.old_search(compoundDomain, compoundContext, self.last_group_by);
},
- start_edition: function (record, options) {
- this.$el.parent().find('.oe_account_select_journal').attr('disabled', 'disabled');
- this.$el.parent().find('.oe_account_select_period').attr('disabled', 'disabled');
- return this._super.apply(this, arguments);
- },
- cancel_edition: function (force) {
- this.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
- this.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
- return this._super.apply(this, arguments);
- },
- save_edition: function () {
- var tmp = this._super.apply(this, arguments);
- var self = this;
- tmp.then(function (saveInfo){
- console.log(saveInfo);
- if (saveInfo) {
- self.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
- self.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
- }
- });
- return tmp;
- }
});
};
From ad2c5376b0613f811141f7cc74730af5e5fd906a Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 19 Nov 2012 13:42:14 +0100
Subject: [PATCH 17/77] [ADD]Period and journal field in tree view with
invisible = 1
bzr revid: dle@openerp.com-20121119124214-0hnx1gg5iksi2gpf
---
addons/account/account_view.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index d3ec35cbea2..f5b21bfcdee 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1069,6 +1069,8 @@
+
+
From f80d9e61003428021b493691d5db2ef8193e58a5 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 19 Nov 2012 14:22:32 +0100
Subject: [PATCH 18/77] [ADD]On_change partner_id and remove useless comments
bzr revid: dle@openerp.com-20121119132232-2ac4n7hodno1r7ju
---
addons/account/account_view.xml | 4 ++--
.../static/src/js/account_move_line_quickadd.js | 17 -----------------
2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index f5b21bfcdee..34e7d3688c2 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1070,13 +1070,13 @@
-
+
-
+
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 5a66e311261..a40774b346f 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -85,23 +85,6 @@ openerp.account.quickadd = function (instance) {
["journal_id", "=", self.current_journal],
["period_id", "=", self.current_period]
]);
- //1
- /*var ncontext = {
- "journal_id": self.current_journal,
- "period_id" :self.current_period,
- };
- var new instance.web.CompoundDomain(self.last_domain = new instance.web.CompoundContext(this.last_context, ncontext);
-
- _.extend(this.dataset.context, ncontext);
- */
- //2
- /*
- var compoundContext = new instance.web.CompoundContext(self.last_context,{
- "journal_id": self.current_journal,
- "period_id" :self.current_period,
- });
- */
- //3
self.last_context["journal_id"] = self.current_journal;
self.last_context["period_id"] = self.current_period;
var compoundContext = self.last_context;
From 20c09c33936453cdaf49f724baffc9418c0275f3 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Wed, 21 Nov 2012 15:26:43 +0100
Subject: [PATCH 19/77] [IMP]Journals views in one, comment of fields_view_get
of account.move.line
bzr revid: dle@openerp.com-20121121142643-g29shtxwf9slvvhi
---
addons/account/account_move_line.py | 200 ++++++++++++++--------------
addons/account/account_view.xml | 100 ++++++++++++--
2 files changed, 190 insertions(+), 110 deletions(-)
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 302a74c27af..98521eb41a8 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -970,126 +970,126 @@ class account_move_line(osv.osv):
'context':context,
}
- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- journal_pool = self.pool.get('account.journal')
- if context is None:
- context = {}
- result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
- if (view_type != 'tree') or view_id:
- #Remove the toolbar from the form view
- if view_type == 'form':
- if result.get('toolbar', False):
- result['toolbar']['action'] = []
- #Restrict the list of journal view in search view
- if view_type == 'search' and result['fields'].get('journal_id', False):
- result['fields']['journal_id']['selection'] = journal_pool.name_search(cr, uid, '', [], context=context)
- ctx = context.copy()
- #we add the refunds journal in the selection field of journal
- if context.get('journal_type', False) == 'sale':
- ctx.update({'journal_type': 'sale_refund'})
- result['fields']['journal_id']['selection'] += journal_pool.name_search(cr, uid, '', [], context=ctx)
- elif context.get('journal_type', False) == 'purchase':
- ctx.update({'journal_type': 'purchase_refund'})
- result['fields']['journal_id']['selection'] += journal_pool.name_search(cr, uid, '', [], context=ctx)
- return result
- if context.get('view_mode', False):
- return result
- fld = []
- flds = []
- title = _("Accounting Entries") # self.view_header_get(cr, uid, view_id, view_type, context)
+ # def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ # journal_pool = self.pool.get('account.journal')
+ # if context is None:
+ # context = {}
+ # result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
+ # if (view_type != 'tree') or view_id:
+ # #Remove the toolbar from the form view
+ # if view_type == 'form':
+ # if result.get('toolbar', False):
+ # result['toolbar']['action'] = []
+ # #Restrict the list of journal view in search view
+ # if view_type == 'search' and result['fields'].get('journal_id', False):
+ # result['fields']['journal_id']['selection'] = journal_pool.name_search(cr, uid, '', [], context=context)
+ # ctx = context.copy()
+ # #we add the refunds journal in the selection field of journal
+ # if context.get('journal_type', False) == 'sale':
+ # ctx.update({'journal_type': 'sale_refund'})
+ # result['fields']['journal_id']['selection'] += journal_pool.name_search(cr, uid, '', [], context=ctx)
+ # elif context.get('journal_type', False) == 'purchase':
+ # ctx.update({'journal_type': 'purchase_refund'})
+ # result['fields']['journal_id']['selection'] += journal_pool.name_search(cr, uid, '', [], context=ctx)
+ # return result
+ # if context.get('view_mode', False):
+ # return result
+ # fld = []
+ # flds = []
+ # title = _("Accounting Entries") # self.view_header_get(cr, uid, view_id, view_type, context)
- ids = journal_pool.search(cr, uid, [], context=context)
- journals = journal_pool.browse(cr, uid, ids, context=context)
- for journal in journals:
- for field in journal.view_id.columns_id:
- # sometimes, it's possible that a defined column is not loaded (the module containing
- # this field is not loaded) when we make an update.
- if field.field not in self._columns:
- continue
+ # ids = journal_pool.search(cr, uid, [], context=context)
+ # journals = journal_pool.browse(cr, uid, ids, context=context)
+ # for journal in journals:
+ # for field in journal.view_id.columns_id:
+ # # sometimes, it's possible that a defined column is not loaded (the module containing
+ # # this field is not loaded) when we make an update.
+ # if field.field not in self._columns:
+ # continue
- if not field.field in flds:
- fld.append((field.field, field.sequence))
- flds.append(field.field)
+ # if not field.field in flds:
+ # fld.append((field.field, field.sequence))
+ # flds.append(field.field)
- default_columns = {
- 'period_id': 3,
- 'journal_id': 10,
- 'state': sys.maxint,
- }
- for d in default_columns:
- if d not in flds:
- fld.append((d, default_columns[d]))
- flds.append(d)
+ # default_columns = {
+ # 'period_id': 3,
+ # 'journal_id': 10,
+ # 'state': sys.maxint,
+ # }
+ # for d in default_columns:
+ # if d not in flds:
+ # fld.append((d, default_columns[d]))
+ # flds.append(d)
- fld = sorted(fld, key=itemgetter(1))
- widths = {
- 'statement_id': 50,
- 'state': 60,
- 'tax_code_id': 50,
- 'move_id': 40,
- }
+ # fld = sorted(fld, key=itemgetter(1))
+ # widths = {
+ # 'statement_id': 50,
+ # 'state': 60,
+ # 'tax_code_id': 50,
+ # 'move_id': 40,
+ # }
- document = etree.Element('tree', string=title, editable="top",
- on_write="on_create_write",
- colors="red:state=='draft';black:state=='valid'")
- fields_get = self.fields_get(cr, uid, flds, context)
- for field, _seq in fld:
- # TODO add string to element
- f = etree.SubElement(document, 'field', name=field)
+ # document = etree.Element('tree', string=title, editable="top",
+ # on_write="on_create_write",
+ # colors="red:state=='draft';black:state=='valid'")
+ # fields_get = self.fields_get(cr, uid, flds, context)
+ # for field, _seq in fld:
+ # # TODO add string to element
+ # f = etree.SubElement(document, 'field', name=field)
- if field == 'debit':
- f.set('sum', _("Total debit"))
+ # if field == 'debit':
+ # f.set('sum', _("Total debit"))
- elif field == 'credit':
- f.set('sum', _("Total credit"))
+ # elif field == 'credit':
+ # f.set('sum', _("Total credit"))
- elif field == 'move_id':
- f.set('required', 'False')
+ # elif field == 'move_id':
+ # f.set('required', 'False')
- elif field == 'account_tax_id':
- f.set('domain', "[('parent_id', '=' ,False)]")
- f.set('context', "{'journal_id': journal_id}")
+ # elif field == 'account_tax_id':
+ # f.set('domain', "[('parent_id', '=' ,False)]")
+ # f.set('context', "{'journal_id': journal_id}")
- elif field == 'account_id' and journal.id:
- f.set('domain', "[('journal_id', '=', journal_id),('type','!=','view'), ('type','!=','closed')]")
- f.set('on_change', 'onchange_account_id(account_id, partner_id)')
+ # elif field == 'account_id' and journal.id:
+ # f.set('domain', "[('journal_id', '=', journal_id),('type','!=','view'), ('type','!=','closed')]")
+ # f.set('on_change', 'onchange_account_id(account_id, partner_id)')
- elif field == 'partner_id':
- f.set('on_change', 'onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)')
+ # elif field == 'partner_id':
+ # f.set('on_change', 'onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)')
- elif field == 'journal_id':
- f.set('context', "{'journal_id': journal_id}")
+ # elif field == 'journal_id':
+ # f.set('context', "{'journal_id': journal_id}")
- elif field == 'statement_id':
- f.set('domain', "[('state', '!=', 'confirm'),('journal_id.type', '=', 'bank')]")
- f.set('invisible', 'True')
+ # elif field == 'statement_id':
+ # f.set('domain', "[('state', '!=', 'confirm'),('journal_id.type', '=', 'bank')]")
+ # f.set('invisible', 'True')
- elif field == 'date':
- f.set('on_change', 'onchange_date(date)')
+ # elif field == 'date':
+ # f.set('on_change', 'onchange_date(date)')
- elif field == 'analytic_account_id':
- # Currently it is not working due to being executed by superclass's fields_view_get
- # f.set('groups', 'analytic.group_analytic_accounting')
- pass
+ # elif field == 'analytic_account_id':
+ # # Currently it is not working due to being executed by superclass's fields_view_get
+ # # f.set('groups', 'analytic.group_analytic_accounting')
+ # pass
- if field in ('amount_currency', 'currency_id'):
- f.set('on_change', 'onchange_currency(account_id, amount_currency, currency_id, date, journal_id)')
- f.set('attrs', "{'readonly': [('state', '=', 'valid')]}")
+ # if field in ('amount_currency', 'currency_id'):
+ # f.set('on_change', 'onchange_currency(account_id, amount_currency, currency_id, date, journal_id)')
+ # f.set('attrs', "{'readonly': [('state', '=', 'valid')]}")
- if field in widths:
- f.set('width', str(widths[field]))
+ # if field in widths:
+ # f.set('width', str(widths[field]))
- if field in ('journal_id',):
- f.set("invisible", "context.get('journal_id', False)")
- elif field in ('period_id',):
- f.set("invisible", "context.get('period_id', False)")
+ # if field in ('journal_id',):
+ # f.set("invisible", "context.get('journal_id', False)")
+ # elif field in ('period_id',):
+ # f.set("invisible", "context.get('period_id', False)")
- orm.setup_modifiers(f, fields_get[field], context=context,
- in_tree_view=True)
+ # orm.setup_modifiers(f, fields_get[field], context=context,
+ # in_tree_view=True)
- result['arch'] = etree.tostring(document, pretty_print=True)
- result['fields'] = fields_get
- return result
+ # result['arch'] = etree.tostring(document, pretty_print=True)
+ # result['fields'] = fields_get
+ # return result
def _check_moves(self, cr, uid, context=None):
# use the first move ever created for this journal and period
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index f7d64f43405..fe40121eaeb 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1063,31 +1063,78 @@
+
account.move.line.tree
account.move.line
-
-
-
-
+
+
-
+
+
-
-
-
-
+
+
+
-
+
+
+
+
+
@@ -1280,6 +1327,39 @@
groups="group_account_user"
/>
+
+ Journal Items
+ account.move.journal
+ form
+ {'journal_type':'sale'}
+ This view is used by accountants in order to record entries massively in OpenERP. If you want to record a customer invoice, select the journal and the period in the search toolbar. Then, start by recording the entry line of the income account. OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account receivable".
+
+
+
+
+ Journal Items
+ account.move.journal
+ form
+ {'journal_type':'purchase'}
+ This view is used by accountants in order to record entries massively in OpenERP. If you want to record a supplier invoice, start by recording the line of the expense account, OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account Payable".
+
+
+
+
+ Journal Items
+ account.move.journal
+ form
+ {'journal_type':'bank'}
+ This view is used by accountants in order to record entries massively in OpenERP. Journal items are created by OpenERP if you use Bank Statements, Cash Registers, or Customer/Supplier payments.
+
+
+
Lines to reconcile
account.move.line
From 0c695e94367f2e4d807c7be0ca5c8748082e92d5 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 09:48:10 +0100
Subject: [PATCH 20/77] [REM]Journal.view and journal.column
bzr revid: dle@openerp.com-20121122084810-mrmgbc8lca21v7l7
---
addons/account/account_view.xml | 78 ---------------------------------
1 file changed, 78 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 164a5fb30d7..19e0f22162c 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -349,84 +349,6 @@
id="menu_unrealized_gains_losses"
parent="account.menu_multi_currency"/>
-
-
-
- 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.
-
-
-
-
-
-
From bf093ee617fe6c2cadf7ae9ed63c42c5206727be Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 10:23:02 +0100
Subject: [PATCH 21/77] [ADD]Reconcile function which return the full or
partial reconcile depending on which is setted for the move line
bzr revid: dle@openerp.com-20121122092302-rji8z8bgbb3p8k14
---
addons/account/account_move_line.py | 10 ++++++++++
addons/account/account_view.xml | 5 ++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 9a67a3c9b19..bbdf2468010 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -477,6 +477,15 @@ class account_move_line(osv.osv):
result.append(line.id)
return result
+ def _get_reconcile(self, cr, uid, ids,name, unknow_none, context=None):
+ res = dict.fromkeys(ids, False)
+ for line in self.browse(cr, uid, ids, context=context):
+ if line.reconcile_id:
+ res[line.id] = str(line.reconcile_id.name)
+ elif line.reconcile_partial_id:
+ res[line.id] = str(line.reconcile_partial_id.name)
+ return res
+
_columns = {
'name': fields.char('Name', size=64, required=True),
'quantity': fields.float('Quantity', digits=(16,2), help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very useful for some reports."),
@@ -491,6 +500,7 @@ class account_move_line(osv.osv):
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),
'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2),
+ 'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile'),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."),
'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."),
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 19e0f22162c..c9c95cd8d69 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1003,8 +1003,7 @@
-
-
+
@@ -1183,7 +1182,7 @@
- Click to register a new journal item.
+ Select the period and the journal you want to fill.
This view can be used by accountants in order to quickly record
entries in OpenERP. If you want to record a supplier invoice,
From 7e1ffaf6132f39baeb3bc1ec7849a43567f09d8a Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 11:45:04 +0100
Subject: [PATCH 22/77] [REM]Remove all account.journal.view and
account.journal.column references
bzr revid: dle@openerp.com-20121122104504-ezgj2666zkhgybpj
---
addons/account/account.py | 117 -----
addons/account/account_bank.py | 6 -
addons/account/account_view.xml | 2 +-
addons/account/data/account_data.xml | 406 ------------------
addons/account/demo/account_minimal.xml | 3 -
addons/account/security/ir.model.access.csv | 4 -
.../account/test/account_fiscalyear_close.yml | 1 -
.../test/account_validate_account_move.yml | 10 +-
.../account_analytic_plans_view.xml | 9 -
addons/account_check_writing/account_view.xml | 2 +-
.../account_sequence_data.xml | 41 +-
addons/account_voucher/test/case1_usd_usd.yml | 1 -
.../test/case2_suppl_usd_eur.yml | 2 -
.../test/case2_usd_eur_debtor_in_eur.yml | 2 -
.../test/case2_usd_eur_debtor_in_usd.yml | 2 -
addons/account_voucher/test/case3_eur_eur.yml | 1 -
addons/account_voucher/test/case4_cad_chf.yml | 1 -
.../test/case5_suppl_usd_usd.yml | 2 -
addons/account_voucher/test/case_eur_usd.yml | 1 -
.../hr_expense/security/ir.model.access.csv | 2 -
.../hr_timesheet/security/ir.model.access.csv | 2 -
.../security/ir.model.access.csv | 4 -
addons/stock/stock_data.xml | 1 -
.../test/stock_location_pull_flow.yml | 2 -
24 files changed, 8 insertions(+), 616 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index 30e0b784de8..8f967760201 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -685,44 +685,6 @@ class account_account(osv.osv):
account_account()
-class account_journal_view(osv.osv):
- _name = "account.journal.view"
- _description = "Journal View"
- _columns = {
- 'name': fields.char('Journal View', size=64, required=True, translate=True),
- 'columns_id': fields.one2many('account.journal.column', 'view_id', 'Columns')
- }
- _order = "name"
-
-account_journal_view()
-
-
-class account_journal_column(osv.osv):
-
- def _col_get(self, cr, user, context=None):
- result = []
- cols = self.pool.get('account.move.line')._columns
- for col in cols:
- if col in ('period_id', 'journal_id'):
- continue
- result.append( (col, cols[col].string) )
- result.sort()
- return result
-
- _name = "account.journal.column"
- _description = "Journal Column"
- _columns = {
- 'name': fields.char('Column Name', size=64, required=True),
- 'field': fields.selection(_col_get, 'Field Name', required=True, size=32),
- 'view_id': fields.many2one('account.journal.view', 'Journal View', select=True),
- 'sequence': fields.integer('Sequence', help="Gives the sequence order to journal column.", readonly=True),
- 'required': fields.boolean('Required'),
- 'readonly': fields.boolean('Readonly'),
- }
- _order = "view_id, sequence"
-
-account_journal_column()
-
class account_journal(osv.osv):
_name = "account.journal"
_description = "Journal"
@@ -738,7 +700,6 @@ class account_journal(osv.osv):
" Select 'Opening/Closing Situation' for entries generated for new fiscal years."),
'type_control_ids': fields.many2many('account.account.type', 'account_journal_type_rel', 'journal_id','type_id', 'Type Controls', domain=[('code','<>','view'), ('code', '<>', 'closed')]),
'account_control_ids': fields.many2many('account.account', 'account_account_type_rel', 'journal_id','account_id', 'Account', domain=[('type','<>','view'), ('type', '<>', 'closed')]),
- #'view_id': fields.many2one('account.journal.view', 'Display Mode', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tells OpenERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."),
'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]", help="It acts as a default account for credit amount"),
'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]", help="It acts as a default account for debit amount"),
'centralisation': fields.boolean('Centralised Counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."),
@@ -874,37 +835,6 @@ class account_journal(osv.osv):
return self.name_get(cr, user, ids, context=context)
- def onchange_type(self, cr, uid, ids, type, currency, context=None):
- obj_data = self.pool.get('ir.model.data')
- user_pool = self.pool.get('res.users')
-
- type_map = {
- 'sale':'account_sp_journal_view',
- 'sale_refund':'account_sp_refund_journal_view',
- 'purchase':'account_sp_journal_view',
- 'purchase_refund':'account_sp_refund_journal_view',
- 'cash':'account_journal_bank_view',
- 'bank':'account_journal_bank_view',
- 'general':'account_journal_view',
- 'situation':'account_journal_view'
- }
-
- res = {}
- view_id = type_map.get(type, 'account_journal_view')
- user = user_pool.browse(cr, uid, uid)
- if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency:
- view_id = 'account_journal_bank_view_multi'
- data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
- data = obj_data.browse(cr, uid, data_id[0], context=context)
-
- res.update({
- 'centralisation':type == 'situation',
- 'view_id':data.res_id,
- })
- return {
- 'value':res
- }
-
account_journal()
class account_fiscalyear(osv.osv):
@@ -3161,53 +3091,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
default_account = acc_template_ref.get(template.property_account_income_opening.id)
return default_account
- def _get_view_id(journal_type):
- # Get the journal views
- if journal_type in ('general', 'situation'):
- data = obj_data.get_object_reference(cr, uid, 'account', 'account_journal_view')
- elif journal_type in ('sale_refund', 'purchase_refund'):
- data = obj_data.get_object_reference(cr, uid, 'account', 'account_sp_refund_journal_view')
- else:
- data = obj_data.get_object_reference(cr, uid, 'account', 'account_sp_journal_view')
- return data and data[1] or False
-
- journal_names = {
- 'sale': _('Sales Journal'),
- 'purchase': _('Purchase Journal'),
- 'sale_refund': _('Sales Refund Journal'),
- 'purchase_refund': _('Purchase Refund Journal'),
- 'general': _('Miscellaneous Journal'),
- 'situation': _('Opening Entries Journal'),
- }
- journal_codes = {
- 'sale': _('SAJ'),
- 'purchase': _('EXJ'),
- 'sale_refund': _('SCNJ'),
- 'purchase_refund': _('ECNJ'),
- 'general': _('MISC'),
- 'situation': _('OPEJ'),
- }
-
- obj_data = self.pool.get('ir.model.data')
- analytic_journal_obj = self.pool.get('account.analytic.journal')
- template = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context)
-
- journal_data = []
- for journal_type in ['sale', 'purchase', 'sale_refund', 'purchase_refund', 'general', 'situation']:
- vals = {
- 'type': journal_type,
- 'name': journal_names[journal_type],
- 'code': journal_codes[journal_type],
- 'company_id': company_id,
- 'centralisation': journal_type == 'situation',
- 'view_id': _get_view_id(journal_type),
- 'analytic_journal_id': _get_analytic_journal(journal_type),
- 'default_credit_account_id': _get_default_account(journal_type, 'credit'),
- 'default_debit_account_id': _get_default_account(journal_type, 'debit'),
- }
- journal_data.append(vals)
- return journal_data
-
def generate_properties(self, cr, uid, chart_template_id, acc_template_ref, company_id, context=None):
"""
This method used for creating properties.
diff --git a/addons/account/account_bank.py b/addons/account/account_bank.py
index 2323f8aaa8a..52b95f1d289 100644
--- a/addons/account/account_bank.py
+++ b/addons/account/account_bank.py
@@ -89,11 +89,6 @@ class bank(osv.osv):
}
acc_bank_id = obj_acc.create(cr,uid,acc,context=context)
- # Get the journal view id
- data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')])
- data = obj_data.browse(cr, uid, data_id[0], context=context)
- view_id_cash = data.res_id
-
jour_obj = self.pool.get('account.journal')
new_code = 1
while True:
@@ -112,7 +107,6 @@ class bank(osv.osv):
'analytic_journal_id': False,
'default_credit_account_id': acc_bank_id,
'default_debit_account_id': acc_bank_id,
- 'view_id': view_id_cash
}
journal_id = jour_obj.create(cr, uid, vals_journal, context=context)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index c9c95cd8d69..0116db16f03 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -397,7 +397,7 @@
-
+
diff --git a/addons/account/data/account_data.xml b/addons/account/data/account_data.xml
index dd27cfbab4e..97bea14c1f2 100644
--- a/addons/account/data/account_data.xml
+++ b/addons/account/data/account_data.xml
@@ -59,412 +59,6 @@
-
-
- Bank/Cash Journal View
-
-
-
- Date
- date
-
-
-
-
-
- Journal Entry
- move_id
-
-
-
-
-
- Name
- name
-
-
-
-
-
- Statement
- statement_id
-
-
-
-
- Partner
- partner_id
-
-
-
-
- Account
- account_id
-
-
-
-
-
- Debit
- debit
-
-
-
-
- Credit
- credit
-
-
-
-
- Ref
- ref
-
-
-
-
- Status
- state
-
-
-
-
- Reconcile
- reconcile_id
-
-
-
-
-
- Bank/Cash Journal (Multi-Currency) View
-
-
-
- Date
- date
-
-
-
-
-
- Journal Entry
- move_id
-
-
-
-
-
- Name
- name
-
-
-
-
-
- Statement
- statement_id
-
-
-
-
- Partner
- partner_id
-
-
-
-
- Account
- account_id
-
-
-
-
-
- Currency Amt.
- amount_currency
-
-
-
-
- Currency
- currency_id
-
-
-
-
- Debit
- debit
-
-
-
-
- Credit
- credit
-
-
-
-
- Ref
- ref
-
-
-
-
- Status
- state
-
-
-
-
- Reconcile
- reconcile_id
-
-
-
-
-
- Journal View
-
-
-
- Date
- date
-
-
-
-
-
- Journal Entry
- move_id
-
-
-
-
-
- Ref
- ref
-
-
-
-
- Partner
- partner_id
-
-
-
-
- Account
- account_id
-
-
-
-
-
- Name
- name
-
-
-
-
-
- Debit
- debit
-
-
-
-
- Credit
- credit
-
-
-
-
- Analytic Account
- analytic_account_id
-
-
-
-
- Status
- state
-
-
-
-
-
- Sale/Purchase Journal View
-
-
-
- Date
- date
-
-
-
-
-
- Journal Entry
- move_id
-
-
-
-
-
- Ref
- ref
-
-
-
-
- Account
- account_id
-
-
-
-
-
- Partner
- partner_id
-
-
-
-
- Name
- name
-
-
-
-
-
- Due Date
- date_maturity
-
-
-
-
- Debit
- debit
-
-
-
-
- Credit
- credit
-
-
-
-
- Tax
- account_tax_id
-
-
-
-
- Analytic Account
- analytic_account_id
-
-
-
-
- Status
- state
-
-
-
-
- Reconcile
- reconcile_id
-
-
-
-
- Sale/Purchase Refund Journal View
-
-
-
- Date
- date
-
-
-
-
-
- Journal Entry
- move_id
-
-
-
-
-
- Ref
- ref
-
-
-
-
- Account
- account_id
-
-
-
-
-
- Partner
- partner_id
-
-
-
-
- Name
- name
-
-
-
-
-
- Due Date
- date_maturity
-
-
-
-
- Debit
- debit
-
-
-
-
- Credit
- credit
-
-
-
-
- Tax
- account_tax_id
-
-
-
-
- Analytic Account
- analytic_account_id
-
-
-
-
- Status
- state
-
-
-
-
- Reconcile
- reconcile_id
-
-
-
diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml
index 984711eceef..d0453cfd365 100644
--- a/addons/account/demo/account_minimal.xml
+++ b/addons/account/demo/account_minimal.xml
@@ -401,7 +401,6 @@
Miscellaneous Journal - (test)
TMIS
general
-
@@ -410,7 +409,6 @@
Opening Entries Journal - (test)
TOEJ
situation
-
@@ -422,7 +420,6 @@
USD Bank Journal - (test)
TUBK
bank
-
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index 28bedbf65a1..d1f0bbab6b5 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -7,8 +7,6 @@ access_account_tax_internal_user,account.tax internal user,model_account_tax,bas
access_account_account,account.account,model_account_account,account.group_account_user,1,0,0,0
access_account_account_user,account.account user,model_account_account,base.group_user,1,0,0,0
access_account_account_partner_manager,account.account partner manager,model_account_account,base.group_partner_manager,1,0,0,0
-access_account_journal_view,account.journal.view,model_account_journal_view,account.group_account_user,1,0,0,0
-access_account_journal_column,account.journal.column,model_account_journal_column,account.group_account_user,1,0,0,0
access_account_journal_period_manager,account.journal.period manager,model_account_journal_period,account.group_account_manager,1,0,0,0
access_account_tax_code,account.tax.code,model_account_tax_code,account.group_account_invoice,1,0,0,0
access_account_tax,account.tax,model_account_tax,account.group_account_invoice,1,0,0,0
@@ -83,8 +81,6 @@ access_account_entries_report_employee,account.entries.report employee,model_acc
access_analytic_entries_report_manager,analytic.entries.report,model_analytic_entries_report,account.group_account_manager,1,0,0,0
access_account_cashbox_line,account.cashbox.line,model_account_cashbox_line,account.group_account_user,1,1,1,1
access_account_journal_cashbox_line,account.journal.cashbox.line,model_account_journal_cashbox_line,account.group_account_user,1,1,1,0
-access_account_journal_view_invoice,account.journal.view invoice,model_account_journal_view,account.group_account_invoice,1,1,1,1
-access_account_journal_column_invoice,account.journal.column invoice,model_account_journal_column,account.group_account_invoice,1,1,1,1
access_account_invoice_tax_accountant,account.invoice.tax accountant,model_account_invoice_tax,account.group_account_user,1,0,0,0
access_account_move_reconcile_manager,account.move.reconcile manager,model_account_move_reconcile,account.group_account_manager,1,0,0,0
access_account_analytic_line_invoice,account.analytic.line invoice,model_account_analytic_line,account.group_account_invoice,1,1,1,1
diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml
index 1e24d2ca0e7..10c949118c9 100644
--- a/addons/account/test/account_fiscalyear_close.yml
+++ b/addons/account/test/account_fiscalyear_close.yml
@@ -29,7 +29,6 @@
default_debit_account_id: cash
default_credit_account_id: cash
company_id: base.main_company
- view_id: account_journal_bank_view
centralisation: 1
-
I called the Generate Fiscalyear Opening Entries wizard
diff --git a/addons/account/test/account_validate_account_move.yml b/addons/account/test/account_validate_account_move.yml
index f5dbbbc92db..9e0141cfff0 100644
--- a/addons/account/test/account_validate_account_move.yml
+++ b/addons/account/test/account_validate_account_move.yml
@@ -32,8 +32,8 @@
import time
date = self._get_date(cr, uid, {'lang': u'en_US', 'normal_view': False, 'active_model': 'ir.ui.menu',
'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'journal_id': 1, 'view_mode': False,
- 'visible_id': 1, 'period_id': 6, 'tz': False, 'active_ids': [ref('action_account_manual_account_move_line_quickadd')],
- 'search_default_posted': 0, 'active_id': ref('action_account_manual_account_move_line_quickadd')})
+ 'visible_id': 1, 'period_id': 6, 'tz': False, 'active_ids': [ref('action_account_moves_all_a')],
+ 'search_default_posted': 0, 'active_id': ref('action_account_moves_all_a')})
partner = self.onchange_partner_id(cr, uid, [], False, ref('base.res_partner_12'), ref('account.cash'), debit=0, credit=2000, date=date, journal=False)
account = self.onchange_account_id(cr, uid, [], account_id=ref('account.a_recv'), partner_id= ref('base.res_partner_12'))
vals = {
@@ -62,11 +62,11 @@
!python {model: account.move.line}: |
ids = self._balance_search(cr, uid, self, 'balance', [('balance', '=', 2000.0)], None, {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'view_mode': False, 'visible_id': 1,
- 'active_ids': [ref('action_account_manual_account_move_line_quickadd')], 'search_default_posted': 0, 'active_id': ref('action_account_manual_account_move_line_quickadd')})
+ 'active_ids': [ref('action_account_moves_all_a')], 'search_default_posted': 0, 'active_id': ref('action_account_moves_all_a')})
bal = self._balance(cr, uid, ids[0][2], 'balance', None,{'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'view_mode': False,
- 'visible_id': 1, 'active_ids': [ref('action_account_manual_account_move_line_quickadd')], 'search_default_posted': 0,
- 'active_id': ref('action_account_manual_account_move_line_quickadd')})
+ 'visible_id': 1, 'active_ids': [ref('action_account_moves_all_a')], 'search_default_posted': 0,
+ 'active_id': ref('action_account_moves_all_a')})
assert bal, 'Balance has not been computed correctly'
-
I check that Initially account move state is "Draft"
diff --git a/addons/account_analytic_plans/account_analytic_plans_view.xml b/addons/account_analytic_plans/account_analytic_plans_view.xml
index e5c02c8640e..3dcbcda6952 100644
--- a/addons/account_analytic_plans/account_analytic_plans_view.xml
+++ b/addons/account_analytic_plans/account_analytic_plans_view.xml
@@ -29,15 +29,6 @@
-
-
-
-
-
-
-
-
-
account.move.line.form.inherit
account.move.line
diff --git a/addons/account_check_writing/account_view.xml b/addons/account_check_writing/account_view.xml
index 53dd1cb1c93..df8d1461a3f 100644
--- a/addons/account_check_writing/account_view.xml
+++ b/addons/account_check_writing/account_view.xml
@@ -11,7 +11,7 @@
account.journal
-
+
diff --git a/addons/account_sequence/account_sequence_data.xml b/addons/account_sequence/account_sequence_data.xml
index b2d40412d0d..21aaaf2baee 100644
--- a/addons/account_sequence/account_sequence_data.xml
+++ b/addons/account_sequence/account_sequence_data.xml
@@ -3,46 +3,7 @@
-
-
-
- Internal Number
- internal_sequence_number
-
-
-
-
-
-
- Internal Number
- internal_sequence_number
-
-
-
-
-
-
- Internal Number
- internal_sequence_number
-
-
-
-
-
-
- Internal Number
- internal_sequence_number
-
-
-
-
-
-
- Internal Number
- internal_sequence_number
-
-
-
+
Account Journal
account.journal
diff --git a/addons/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml
index 300d565f229..0f4c2058fc7 100644
--- a/addons/account_voucher/test/case1_usd_usd.yml
+++ b/addons/account_voucher/test/case1_usd_usd.yml
@@ -66,7 +66,6 @@
default_credit_account_id: account_cash_usd_id
currency: base.USD
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create the first invoice on 1st January for 200 USD
diff --git a/addons/account_voucher/test/case2_suppl_usd_eur.yml b/addons/account_voucher/test/case2_suppl_usd_eur.yml
index 1a0c250395e..b32228032d3 100644
--- a/addons/account_voucher/test/case2_suppl_usd_eur.yml
+++ b/addons/account_voucher/test/case2_suppl_usd_eur.yml
@@ -23,7 +23,6 @@
default_credit_account_id: account.cash
currency: base.EUR
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create a bank journal with USD as currency
-
@@ -37,7 +36,6 @@
default_credit_account_id: account.cash
currency: base.USD
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create the first invoice on 1st January for 200 USD
-
diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
index 91f8a629cbb..275e4c58835 100644
--- a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
+++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
@@ -59,7 +59,6 @@
default_debit_account_id: account.cash
default_credit_account_id: account.cash
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create a bank journal with USD as currency
-
@@ -73,7 +72,6 @@
default_credit_account_id: account_cash_usd_id
currency: base.USD
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create the first invoice on 1st January for 200 USD
-
diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
index cc5e819af30..667882e3a32 100644
--- a/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
+++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
@@ -59,7 +59,6 @@
default_debit_account_id: account.cash
default_credit_account_id: account.cash
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create a bank journal with USD as currency
-
@@ -73,7 +72,6 @@
default_credit_account_id: account_cash_usd_id
currency: base.USD
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create the first invoice on 1st January for 200 USD
-
diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml
index 37ea7ea981a..f2f9461c31e 100644
--- a/addons/account_voucher/test/case3_eur_eur.yml
+++ b/addons/account_voucher/test/case3_eur_eur.yml
@@ -27,7 +27,6 @@
default_debit_account_id: account.cash
default_credit_account_id: account.cash
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create the first invoice on 1st January for 150 EUR
-
diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml
index a2b252497cd..bc33e387a85 100644
--- a/addons/account_voucher/test/case4_cad_chf.yml
+++ b/addons/account_voucher/test/case4_cad_chf.yml
@@ -61,7 +61,6 @@
default_credit_account_id: account_cash_chf_id
currency: base.CHF
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create the first invoice on 1st January for 200 CAD
-
diff --git a/addons/account_voucher/test/case5_suppl_usd_usd.yml b/addons/account_voucher/test/case5_suppl_usd_usd.yml
index 3cae9667d84..55377825dcb 100644
--- a/addons/account_voucher/test/case5_suppl_usd_usd.yml
+++ b/addons/account_voucher/test/case5_suppl_usd_usd.yml
@@ -46,7 +46,6 @@
default_debit_account_id: account.cash
default_credit_account_id: account.cash
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create a bank journal with USD as currency
-
@@ -60,7 +59,6 @@
default_credit_account_id: account_cash_usd_id
currency: base.USD
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I set the context as would do the action in supplier invoice menuitem
-
diff --git a/addons/account_voucher/test/case_eur_usd.yml b/addons/account_voucher/test/case_eur_usd.yml
index 125277191cb..94f0c718980 100644
--- a/addons/account_voucher/test/case_eur_usd.yml
+++ b/addons/account_voucher/test/case_eur_usd.yml
@@ -40,7 +40,6 @@
default_credit_account_id: account_eur_usd_id
currency: base.USD
company_id: base.main_company
- view_id: account.account_journal_bank_view
-
I create an invoice
-
diff --git a/addons/hr_expense/security/ir.model.access.csv b/addons/hr_expense/security/ir.model.access.csv
index 092424ef7e6..361a3d8c74f 100644
--- a/addons/hr_expense/security/ir.model.access.csv
+++ b/addons/hr_expense/security/ir.model.access.csv
@@ -20,5 +20,3 @@ access_account_move_user,account.move.user,account.model_account_move,base.group
access_account_move_line_user,account.move.line.user,account.model_account_move_line,base.group_hr_user,1,1,1,1
access_account_analytic_line_user,account.ianalytic.line.user,account.model_account_analytic_line,base.group_hr_user,1,1,1,1
access_account_journal_period_manager,account.journal.period.manager,account.model_account_journal_period,base.group_hr_manager,1,1,1,1
-hr.access_account_journal_view_hruser,account.journal.view hruser,account.model_account_journal_view,base.group_hr_user,1,0,0,0
-hr.access_account_journal_column_hruser,account.journal.column hruser,account.model_account_journal_column,base.group_hr_user,1,0,0,0
diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv
index 069a5a9c170..689d425054a 100644
--- a/addons/hr_timesheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet/security/ir.model.access.csv
@@ -8,7 +8,5 @@ access_product_product_user,product.product user,product.model_product_product,b
access_product_template_hr_timesheet,product.template.hr.timesheet,product.model_product_template,base.group_hr_user,1,1,1,1
access_product_uom_hr_timesheet,product.uom.hr.timesheet,product.model_product_uom,base.group_hr_user,1,1,1,1
access_account_fiscalyear_hr_user,account.account.fiscalyear.user,account.model_account_fiscalyear,base.group_hr_user,1,1,1,1
-hr.access_account_journal_view_hruser,account.journal.view hruser,account.model_account_journal_view,base.group_hr_user,1,0,0,0
-hr.access_account_journal_column_hruser,account.journal.column hruser,account.model_account_journal_column,base.group_hr_user,1,0,0,0
access_hr_analytic_timesheet_user,hr.analytic.timesheet.user,model_hr_analytic_timesheet,base.group_user,1,1,1,0
access_account_analytic_journal_user,account.account.analytic.journal.user,account.model_account_analytic_journal,base.group_user,1,0,0,0
diff --git a/addons/point_of_sale/security/ir.model.access.csv b/addons/point_of_sale/security/ir.model.access.csv
index 74b4bbf5753..1d2c22053fb 100644
--- a/addons/point_of_sale/security/ir.model.access.csv
+++ b/addons/point_of_sale/security/ir.model.access.csv
@@ -42,12 +42,8 @@ access_account_move,account.move,account.model_account_move,group_pos_manager,1,
access_account_journal,account.journal,account.model_account_journal,group_pos_user,1,1,1,0
access_account_journal_period_user,account.journal.period user,account.model_account_journal_period,group_pos_user,1,1,1,1
access_account_journal_period_manager,account.journal.period manager,account.model_account_journal_period,group_pos_manager,1,0,0,0
-access_account_journal_view,account.journal.view,account.model_account_journal_view,group_pos_user,1,1,1,0
-access_account_journal_view_manager,account.journal.view manager,account.model_account_journal_view,group_pos_manager,1,0,0,0
access_account_analytic_line,account.analytic.line,analytic.model_account_analytic_line,group_pos_user,1,1,1,0
access_account_analytic_account,account.analytic.account,analytic.model_account_analytic_account,group_pos_user,1,1,1,0
-access_account_journal_column,account.journal.column,account.model_account_journal_column,group_pos_user,1,1,1,0
-access_account_journal_column_manager,account.journal.column manager,account.model_account_journal_column,group_pos_manager,1,0,0,0
access_ir_property_pos_manager,ir.property manager,base.model_ir_property,group_pos_manager,1,1,1,1
access_account_bank_statement_line_manager,account.bank.statement.line manager,account.model_account_bank_statement_line,group_pos_manager,1,1,1,1
access_account_invoice_manager,account.invoice manager,account.model_account_invoice,group_pos_manager,1,1,1,1
diff --git a/addons/stock/stock_data.xml b/addons/stock/stock_data.xml
index a1ce136e304..6a955d950bb 100644
--- a/addons/stock/stock_data.xml
+++ b/addons/stock/stock_data.xml
@@ -21,7 +21,6 @@ watch your stock valuation, and track production lots upstream and downstream (b
Stock Journal
STJ
general
-
diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml
index a7dd7d82607..0ff1b5d3af8 100644
--- a/addons/stock_location/test/stock_location_pull_flow.yml
+++ b/addons/stock_location/test/stock_location_pull_flow.yml
@@ -58,7 +58,6 @@
name: Purchase Journal For Tests
sequence_id: account.sequence_purchase_journal
type: purchase
- view_id: account.account_journal_bank_view
-
I create a Sale Journal.
@@ -69,7 +68,6 @@
name: Sale Journal For Tests
sequence_id: account.sequence_sale_journal
type: sale
- view_id: account.account_journal_view
-
I create an Expense Account
From eeeae94645a772e26475639f93dd40cfbabe115b Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 12:05:28 +0100
Subject: [PATCH 23/77] [DEL]view_id references in account_minimal.xml
bzr revid: dle@openerp.com-20121122110528-nxsqszj88fgim2jj
---
addons/account/demo/account_minimal.xml | 7 -------
1 file changed, 7 deletions(-)
diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml
index d0453cfd365..ce9a09def08 100644
--- a/addons/account/demo/account_minimal.xml
+++ b/addons/account/demo/account_minimal.xml
@@ -312,7 +312,6 @@
Sales Journal - (test)
TSAJ
sale
-
@@ -323,7 +322,6 @@
Sales Credit Note Journal - (test)
TSCNJ
sale_refund
-
@@ -335,7 +333,6 @@
Expenses Journal - (test)
TEXJ
purchase
-
@@ -346,7 +343,6 @@
Expenses Credit Notes Journal - (test)
TECNJ
purchase_refund
-
@@ -358,7 +354,6 @@
Bank Journal - (test)
TBNK
bank
-
@@ -369,7 +364,6 @@
Checks Journal - (test)
TCHK
bank
-
@@ -390,7 +384,6 @@
that test OpenERP arrive directly in the touchscreen UI.
-->
-
From 7e6b2035ae12eddfc72d1b81e44005e74c035811 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 12:27:29 +0100
Subject: [PATCH 24/77] [DEL]View_id references missed
bzr revid: dle@openerp.com-20121122112729-0osh95257ssn5sxy
---
addons/account/account.py | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index 8f967760201..af0d5147220 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -3300,11 +3300,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'''
obj_data = self.pool.get('ir.model.data')
obj_journal = self.pool.get('account.journal')
- # Get the id of journal views
- tmp = obj_data.get_object_reference(cr, uid, 'account', 'account_journal_bank_view_multi')
- view_id_cur = tmp and tmp[1] or False
- tmp = obj_data.get_object_reference(cr, uid, 'account', 'account_journal_bank_view')
- view_id_cash = tmp and tmp[1] or False
+
# we need to loop again to find next number for journal code
# because we can't rely on the value current_num as,
@@ -3330,10 +3326,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'default_debit_account_id': default_account_id,
}
if line['currency_id']:
- vals['view_id'] = view_id_cur
vals['currency'] = line['currency_id']
- else:
- vals['view_id'] = view_id_cash
+
return vals
def _prepare_bank_account(self, cr, uid, line, new_code, acc_template_ref, ref_acc_bank, company_id, context=None):
From 49f3f3d39f3a844b50d4666bce5bb2ea5a5c4989 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 12:55:17 +0100
Subject: [PATCH 25/77] [FIX]Too much deleted in _prepare_all_journals
bzr revid: dle@openerp.com-20121122115517-j1i3srgux7extgp8
---
addons/account/account.py | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/addons/account/account.py b/addons/account/account.py
index af0d5147220..88d6bebb9f5 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -3091,6 +3091,42 @@ class wizard_multi_charts_accounts(osv.osv_memory):
default_account = acc_template_ref.get(template.property_account_income_opening.id)
return default_account
+ journal_names = {
+ 'sale': _('Sales Journal'),
+ 'purchase': _('Purchase Journal'),
+ 'sale_refund': _('Sales Refund Journal'),
+ 'purchase_refund': _('Purchase Refund Journal'),
+ 'general': _('Miscellaneous Journal'),
+ 'situation': _('Opening Entries Journal'),
+ }
+ journal_codes = {
+ 'sale': _('SAJ'),
+ 'purchase': _('EXJ'),
+ 'sale_refund': _('SCNJ'),
+ 'purchase_refund': _('ECNJ'),
+ 'general': _('MISC'),
+ 'situation': _('OPEJ'),
+ }
+
+ obj_data = self.pool.get('ir.model.data')
+ analytic_journal_obj = self.pool.get('account.analytic.journal')
+ template = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context)
+
+ journal_data = []
+ for journal_type in ['sale', 'purchase', 'sale_refund', 'purchase_refund', 'general', 'situation']:
+ vals = {
+ 'type': journal_type,
+ 'name': journal_names[journal_type],
+ 'code': journal_codes[journal_type],
+ 'company_id': company_id,
+ 'centralisation': journal_type == 'situation',
+ 'analytic_journal_id': _get_analytic_journal(journal_type),
+ 'default_credit_account_id': _get_default_account(journal_type, 'credit'),
+ 'default_debit_account_id': _get_default_account(journal_type, 'debit'),
+ }
+ journal_data.append(vals)
+ return journal_data
+
def generate_properties(self, cr, uid, chart_template_id, acc_template_ref, company_id, context=None):
"""
This method used for creating properties.
From f1bf09c057b3b7b13f0b25646ee679bbeaa037f8 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 13:16:11 +0100
Subject: [PATCH 26/77] [DEL]Missed view_id ref in l10n_ch/journal_data.xml
bzr revid: dle@openerp.com-20121122121611-8mwds44161l1n25f
---
addons/l10n_ch/journal_data.xml | 6 ------
1 file changed, 6 deletions(-)
diff --git a/addons/l10n_ch/journal_data.xml b/addons/l10n_ch/journal_data.xml
index ede9136c3d2..607273ed401 100644
--- a/addons/l10n_ch/journal_data.xml
+++ b/addons/l10n_ch/journal_data.xml
@@ -5,7 +5,6 @@
Journal de frais
EXPF
purchase
-
@@ -15,7 +14,6 @@
Banque CHF
BCHF
bank
-
@@ -26,7 +24,6 @@
Banque EUR
BEUR
bank
-
@@ -37,7 +34,6 @@
Caisse
CAI
cash
-
@@ -47,7 +43,6 @@
Opérations Diverses
OD
general
-
@@ -58,7 +53,6 @@
JO
situation
True
-
From e18841b518cfad71a267ced4ab1658d32e602573 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 13:37:16 +0100
Subject: [PATCH 27/77] [DEL]Missed view_id ref in
multi_company/multi_company_demo.xml
bzr revid: dle@openerp.com-20121122123716-lohu4xuhjd2nzm4c
---
addons/multi_company/multi_company_demo.xml | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/addons/multi_company/multi_company_demo.xml b/addons/multi_company/multi_company_demo.xml
index 00c68186108..088aa35e915 100644
--- a/addons/multi_company/multi_company_demo.xml
+++ b/addons/multi_company/multi_company_demo.xml
@@ -191,7 +191,6 @@
Sales Journal - (OpenERP IN)
SAJ-OpenERP IN
sale
-
@@ -204,7 +203,6 @@
Sales Credit Note Journal - (OpenERP IN)
SCNJ-OpenERP IN
sale_refund
-
@@ -217,7 +215,6 @@
Expenses Journal - (OpenERP IN)
EXJ-OpenERP IN
purchase
-
@@ -230,7 +227,6 @@
Expenses Credit Notes Journal - (OpenERP IN)
ECNJ-OpenERP IN
purchase_refund
-
@@ -243,7 +239,6 @@
Bank Journal - (OpenERP IN)
BNK-OpenERP IN
bank
-
@@ -256,7 +251,6 @@
Checks Journal - (OpenERP IN)
CHK-OpenERP IN
bank
-
@@ -269,7 +263,6 @@
Cash Journal - (OpenERP IN)
CSH-OpenERP IN
cash
-
@@ -283,7 +276,6 @@
Sales Journal - (OpenERP US)
SAJ-OpenERP US
sale
-
@@ -296,7 +288,6 @@
Sales Credit Note Journal - (OpenERP US)
SCNJ-OpenERP US
sale_refund
-
@@ -309,7 +300,6 @@
Expenses Journal - (OpenERP US)
EXJ-OpenERP US
purchase
-
@@ -322,7 +312,6 @@
Expenses Credit Notes Journal - (OpenERP US)
ECNJ-OpenERP US
purchase_refund
-
@@ -335,7 +324,6 @@
Bank Journal - (OpenERP US)
BNK-OpenERP US
bank
-
@@ -348,7 +336,6 @@
Checks Journal - (OpenERP US)
CHK-OpenERP US
bank
-
@@ -361,7 +348,6 @@
Cash Journal - (OpenERP US)
CSH-OpenERP US
cash
-
@@ -376,7 +362,6 @@
Sales Journal - (OpenERP BE)
SAJ-OpenERP BE
sale
-
@@ -389,7 +374,6 @@
Sales Credit Note Journal - (OpenERP BE)
SCNJ-OpenERP BE
sale_refund
-
@@ -402,7 +386,6 @@
Expenses Journal - (OpenERP BE)
EXJ-OpenERP BE
purchase
-
@@ -415,7 +398,6 @@
Expenses Credit Notes Journal - (OpenERP BE)
ECNJ-OpenERP BE
purchase_refund
-
@@ -428,7 +410,6 @@
Bank Journal - (OpenERP BE)
BNK-OpenERP BE
bank
-
@@ -441,7 +422,6 @@
Checks Journal - (OpenERP BE)
CHK-OpenERP BE
bank
-
@@ -454,7 +434,6 @@
Cash Journal - (OpenERP BE)
CSH-OpenERP BE
cash
-
From 87477cdc529c0a52c2593fe0b66afe2303fc2bad Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 14:50:09 +0100
Subject: [PATCH 28/77] [DEL]view_mode: true in quickadd action
bzr revid: dle@openerp.com-20121122135009-x1qty81i13gguan6
---
addons/account/account_view.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 0116db16f03..0de0898e409 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -350,8 +350,8 @@
parent="account.menu_multi_currency"/>
+ # Account Journal
+ -->
account.journal.tree
@@ -1178,7 +1178,7 @@
account.move.line
form
tree_account_move_line_quickadd
- {'journal_type':'general','view_mode':True}
+ {'journal_type':'general'}
From 0a5e921dff21ef99029a27b384397742c20cc84f Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 15:28:59 +0100
Subject: [PATCH 29/77] [ADD]Possibility to select no journal and/or no period
bzr revid: dle@openerp.com-20121122142859-dornyupukdeaya5y
---
addons/account/account_move_line.py | 1 -
addons/account/account_view.xml | 4 +--
.../src/js/account_move_line_quickadd.js | 33 +++++++++----------
3 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index bbdf2468010..1128ff465fe 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -1428,7 +1428,6 @@ class account_move_line(osv.osv):
ng = dict(self.pool.get('account.journal').name_search(cr,uid,'',[]))
ids = ng.keys()
result = []
- print ng
for journal in self.pool.get('account.journal').browse(cr, uid, ids, context=context):
result.append((journal.id,ng[journal.id],journal.type,
bool(journal.currency),bool(journal.analytic_journal_id)))
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 0de0898e409..c62607e12a1 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -991,6 +991,8 @@
+
+
@@ -1008,8 +1010,6 @@
-
-
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 6ce27930741..2535a888bc9 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -28,11 +28,11 @@ openerp.account.quickadd = function (instance) {
this.$el.parent().prepend(QWeb.render("AccountMoveLineQuickAdd", {widget: this}));
this.$el.parent().find('.oe_account_select_journal').change(function() {
- self.current_journal = parseInt(this.value);
+ self.current_journal = this.value === '' ? null : parseInt(this.value);
self.do_search(self.last_domain, self.last_context, self.last_group_by);
});
this.$el.parent().find('.oe_account_select_period').change(function() {
- self.current_period = parseInt(this.value);
+ self.current_period = this.value === '' ? null : parseInt(this.value);
self.do_search(self.last_domain, self.last_context, self.last_group_by);
});
this.on('edit:after', this, function () {
@@ -43,6 +43,11 @@ openerp.account.quickadd = function (instance) {
self.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
self.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
});
+ var mod = new instance.web.Model("account.move.line", self.dataset.context, self.dataset.domain);
+ mod.call("default_get", [['journal_id','period_id'],self.dataset.context]).then(function(result) {
+ self.current_period = result['period_id'];
+ self.current_journal = result['journal_id'];
+ });
return tmp;
},
do_search: function(domain, context, group_by) {
@@ -56,15 +61,10 @@ openerp.account.quickadd = function (instance) {
self.journals = result;
}),mod.call("list_periods", []).then(function(result) {
self.periods = result;
- }),mod.call("default_get", [['journal_id','period_id'],self.last_context]).then(function(result) {
- self.default_period = result['period_id'];
- self.default_journal = result['journal_id'];
})).then(function () {
- self.current_journal = self.current_journal === null ? self.default_journal : self.current_journal;
- self.current_period = self.current_period === null ? self.default_period :self.current_period;
var o;
- //self.$('.oe_account_select_journal',self.$el.parent())[0].children().remove().end();
self.$el.parent().find('.oe_account_select_journal').children().remove().end();
+ self.$el.parent().find('.oe_account_select_journal').append(new Option('', ''));
for (var i = 0;i < self.journals.length;i++){
o = new Option(self.journals[i][1], self.journals[i][0]);
if (self.journals[i][0] === self.current_journal){
@@ -76,6 +76,7 @@ openerp.account.quickadd = function (instance) {
self.$el.parent().find('.oe_account_select_journal').append(o);
}
self.$el.parent().find('.oe_account_select_period').children().remove().end();
+ self.$el.parent().find('.oe_account_select_period').append(new Option('', ''));
for (var i = 0;i < self.periods.length;i++){
o = new Option(self.periods[i][1], self.periods[i][0]);
self.$el.parent().find('.oe_account_select_period').append(o);
@@ -86,19 +87,15 @@ openerp.account.quickadd = function (instance) {
},
search_by_journal_period: function() {
var self = this;
-
- var compoundDomain = new instance.web.CompoundDomain(self.last_domain,
- [
- ["journal_id", "=", self.current_journal],
- ["period_id", "=", self.current_period]
- ]);
- self.last_context["journal_id"] = self.current_journal;
- self.last_context["period_id"] = self.current_period;
+ var domain = [];
+ if (self.current_journal !== null) domain.push(["journal_id", "=", self.current_journal]);
+ if (self.current_period !== null) domain.push(["period_id", "=", self.current_period]);
+ self.last_context["journal_id"] = self.current_journal === null ? false : self.current_journal;
+ self.last_context["period_id"] = self.current_period === null ? false : self.current_period;
self.last_context["journal_type"] = self.current_journal_type;
self.last_context["currency"] = self.current_journal_currency;
self.last_context["analytic_journal_id"] = self.current_journal_analytic;
- var compoundContext = self.last_context;
- return self.old_search(compoundDomain, compoundContext, self.last_group_by);
+ return self.old_search(new instance.web.CompoundDomain(self.last_domain, domain), self.last_context, self.last_group_by);
},
});
};
From 44c948caf4e4beec8863e2848aef7a56d789442b Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 16:06:45 +0100
Subject: [PATCH 30/77] [FIX]Possibility to choose journal none and period none
bzr revid: dle@openerp.com-20121122150645-kxfuwdfy6qxvjvxu
---
addons/account/account_move_line.py | 11 ++++++++---
addons/account/account_view.xml | 5 +++--
.../static/src/js/account_move_line_quickadd.js | 3 ++-
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 1128ff465fe..4fb78392326 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -505,11 +505,11 @@ class account_move_line(osv.osv):
'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."),
'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."),
'currency_id': fields.many2one('res.currency', 'Currency', help="The optional other currency if it is a multi-currency entry."),
- 'journal_id': fields.related('move_id', 'journal_id', string='Journal', type='many2one', relation='account.journal', required=True, select=True, readonly=True,
+ 'journal_id': fields.related('move_id', 'journal_id', string='Journal', type='many2one', relation='account.journal', required=True, select=True,
store = {
'account.move': (_get_move_lines, ['journal_id'], 20)
}),
- 'period_id': fields.related('move_id', 'period_id', string='Period', type='many2one', relation='account.period', required=True, select=True, readonly=True,
+ 'period_id': fields.related('move_id', 'period_id', string='Period', type='many2one', relation='account.period', required=True, select=True,
store = {
'account.move': (_get_move_lines, ['period_id'], 20)
}),
@@ -565,6 +565,9 @@ class account_move_line(osv.osv):
"""
Return default account period value
"""
+ context = context or {}
+ if context.get('period_id', False):
+ return context['period_id']
account_period_obj = self.pool.get('account.period')
ids = account_period_obj.find(cr, uid, context=context)
period_id = False
@@ -576,7 +579,9 @@ class account_move_line(osv.osv):
"""
Return journal based on the journal type
"""
-
+ context = context or {}
+ if context.get('journal_id', False):
+ return context['journal_id']
journal_id = False
journal_pool = self.pool.get('account.journal')
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index c62607e12a1..eae8f902d78 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -991,8 +991,8 @@
-
-
+
+
@@ -1010,6 +1010,7 @@
+
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 2535a888bc9..8eda55876e3 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -91,7 +91,8 @@ openerp.account.quickadd = function (instance) {
if (self.current_journal !== null) domain.push(["journal_id", "=", self.current_journal]);
if (self.current_period !== null) domain.push(["period_id", "=", self.current_period]);
self.last_context["journal_id"] = self.current_journal === null ? false : self.current_journal;
- self.last_context["period_id"] = self.current_period === null ? false : self.current_period;
+ if (self.current_period === null) delete self.last_context["period_id"];
+ else self.last_context["period_id"] = self.current_period;
self.last_context["journal_type"] = self.current_journal_type;
self.last_context["currency"] = self.current_journal_currency;
self.last_context["analytic_journal_id"] = self.current_journal_analytic;
From 4e9f308bef5c300a4a572a1232aa33aec58cb3bb Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Thu, 22 Nov 2012 16:26:12 +0100
Subject: [PATCH 31/77] [DEL]Remove commented useless fields_view_get
bzr revid: dle@openerp.com-20121122152612-i4k15g2k73pd7b1l
---
addons/account/account_move_line.py | 121 ----------------------------
1 file changed, 121 deletions(-)
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 4fb78392326..9b8431d6980 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -1012,127 +1012,6 @@ class account_move_line(osv.osv):
'context':context,
}
- # def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- # journal_pool = self.pool.get('account.journal')
- # if context is None:
- # context = {}
- # result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
- # if (view_type != 'tree') or view_id:
- # #Remove the toolbar from the form view
- # if view_type == 'form':
- # if result.get('toolbar', False):
- # result['toolbar']['action'] = []
- # #Restrict the list of journal view in search view
- # if view_type == 'search' and result['fields'].get('journal_id', False):
- # result['fields']['journal_id']['selection'] = journal_pool.name_search(cr, uid, '', [], context=context)
- # ctx = context.copy()
- # #we add the refunds journal in the selection field of journal
- # if context.get('journal_type', False) == 'sale':
- # ctx.update({'journal_type': 'sale_refund'})
- # result['fields']['journal_id']['selection'] += journal_pool.name_search(cr, uid, '', [], context=ctx)
- # elif context.get('journal_type', False) == 'purchase':
- # ctx.update({'journal_type': 'purchase_refund'})
- # result['fields']['journal_id']['selection'] += journal_pool.name_search(cr, uid, '', [], context=ctx)
- # return result
- # if context.get('view_mode', False):
- # return result
- # fld = []
- # flds = []
- # title = _("Accounting Entries") # self.view_header_get(cr, uid, view_id, view_type, context)
-
- # ids = journal_pool.search(cr, uid, [], context=context)
- # journals = journal_pool.browse(cr, uid, ids, context=context)
- # for journal in journals:
- # for field in journal.view_id.columns_id:
- # # sometimes, it's possible that a defined column is not loaded (the module containing
- # # this field is not loaded) when we make an update.
- # if field.field not in self._columns:
- # continue
-
- # if not field.field in flds:
- # fld.append((field.field, field.sequence))
- # flds.append(field.field)
-
- # default_columns = {
- # 'period_id': 3,
- # 'journal_id': 10,
- # 'state': sys.maxint,
- # }
- # for d in default_columns:
- # if d not in flds:
- # fld.append((d, default_columns[d]))
- # flds.append(d)
-
- # fld = sorted(fld, key=itemgetter(1))
- # widths = {
- # 'statement_id': 50,
- # 'state': 60,
- # 'tax_code_id': 50,
- # 'move_id': 40,
- # }
-
- # document = etree.Element('tree', string=title, editable="top",
- # on_write="on_create_write",
- # colors="red:state=='draft';black:state=='valid'")
- # fields_get = self.fields_get(cr, uid, flds, context)
- # for field, _seq in fld:
- # # TODO add string to element
- # f = etree.SubElement(document, 'field', name=field)
-
- # if field == 'debit':
- # f.set('sum', _("Total debit"))
-
- # elif field == 'credit':
- # f.set('sum', _("Total credit"))
-
- # elif field == 'move_id':
- # f.set('required', 'False')
-
- # elif field == 'account_tax_id':
- # f.set('domain', "[('parent_id', '=' ,False)]")
- # f.set('context', "{'journal_id': journal_id}")
-
- # elif field == 'account_id' and journal.id:
- # f.set('domain', "[('journal_id', '=', journal_id),('type','!=','view'), ('type','!=','closed')]")
- # f.set('on_change', 'onchange_account_id(account_id, partner_id)')
-
- # elif field == 'partner_id':
- # f.set('on_change', 'onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)')
-
- # elif field == 'journal_id':
- # f.set('context', "{'journal_id': journal_id}")
-
- # elif field == 'statement_id':
- # f.set('domain', "[('state', '!=', 'confirm'),('journal_id.type', '=', 'bank')]")
- # f.set('invisible', 'True')
-
- # elif field == 'date':
- # f.set('on_change', 'onchange_date(date)')
-
- # elif field == 'analytic_account_id':
- # # Currently it is not working due to being executed by superclass's fields_view_get
- # # f.set('groups', 'analytic.group_analytic_accounting')
- # pass
-
- # if field in ('amount_currency', 'currency_id'):
- # f.set('on_change', 'onchange_currency(account_id, amount_currency, currency_id, date, journal_id)')
- # f.set('attrs', "{'readonly': [('state', '=', 'valid')]}")
-
- # if field in widths:
- # f.set('width', str(widths[field]))
-
- # if field in ('journal_id',):
- # f.set("invisible", "context.get('journal_id', False)")
- # elif field in ('period_id',):
- # f.set("invisible", "context.get('period_id', False)")
-
- # orm.setup_modifiers(f, fields_get[field], context=context,
- # in_tree_view=True)
-
- # result['arch'] = etree.tostring(document, pretty_print=True)
- # result['fields'] = fields_get
- # return result
-
def _check_moves(self, cr, uid, context=None):
# use the first move ever created for this journal and period
if context is None:
From d85b143ad0231d9b6656ddbe52f6406dc28920f6 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Fri, 23 Nov 2012 16:22:13 +0100
Subject: [PATCH 32/77] [FIX]Create button
bzr revid: dle@openerp.com-20121123152213-jhkdixgoypdwoj4f
---
addons/account/account_view.xml | 32 ++-----------------
.../src/js/account_move_line_quickadd.js | 5 +--
2 files changed, 3 insertions(+), 34 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index eae8f902d78..0b6b23ecb82 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1175,11 +1175,11 @@
+ {'journal_type':'general'}
Journal Items
account.move.line
- form
+
tree_account_move_line_quickadd
- {'journal_type':'general'}
@@ -1449,25 +1449,6 @@
res_model="account.move.line"
src_model="account.move"/>
-
- Journal Items
- account.move.line
- form
- tree,form
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
{'search_default_unreconciled': 1,'view_mode':True}
@@ -1886,15 +1867,6 @@
-
- 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
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 8eda55876e3..997b2b03bb6 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -1,15 +1,12 @@
-
openerp.account.quickadd = function (instance) {
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb;
instance.web.account = instance.web.account || {};
-
+
instance.web.views.add('tree_account_move_line_quickadd', 'instance.web.account.QuickAddListView');
instance.web.account.QuickAddListView = instance.web.ListView.extend({
- _template: 'ListView',
-
init: function() {
this._super.apply(this, arguments);
this.journals = [];
From 7db911f1c7670b9b79d1c7825e58bd60579edd7c Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Fri, 23 Nov 2012 17:27:58 +0100
Subject: [PATCH 33/77] [REF] account: refactoring of default_get() of
account.move.line
bzr revid: qdp-launchpad@openerp.com-20121123162758-qczz3bgbea2qzxjo
---
addons/account/account.py | 7 -
addons/account/account_move_line.py | 196 ++++++++++------------------
addons/account/account_view.xml | 7 +-
addons/account/res_currency.py | 1 +
4 files changed, 72 insertions(+), 139 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index 88d6bebb9f5..14f342a7782 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1314,13 +1314,6 @@ class account_move(osv.osv):
'WHERE id IN %s', ('draft', tuple(ids),))
return True
- def onchange_line_id(self, cr, uid, ids, line_ids, context=None):
- balance = 0.0
- for line in line_ids:
- if line[2]:
- balance += (line[2].get('debit',0.00)- (line[2].get('credit',0.00)))
- return {'value': {'balance': balance}}
-
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 9b8431d6980..84de5548fce 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -213,12 +213,11 @@ class account_move_line(osv.osv):
return context
def _default_get(self, cr, uid, fields, context=None):
+ #default_get should only do the following:
+ # -propose the next amount in debit/credit in order to balance the move
+ # -propose the next account from the journal (default debit/credit account) accordingly
if context is None:
context = {}
- if not context.get('journal_id', False):
- context['journal_id'] = context.get('search_default_journal_id')
- if not context.get('period_id', False):
- context['period_id'] = context.get('search_default_period_id')
account_obj = self.pool.get('account.account')
period_obj = self.pool.get('account.period')
journal_obj = self.pool.get('account.journal')
@@ -227,134 +226,71 @@ class account_move_line(osv.osv):
fiscal_pos_obj = self.pool.get('account.fiscal.position')
partner_obj = self.pool.get('res.partner')
currency_obj = self.pool.get('res.currency')
+
+ if not context.get('journal_id', False):
+ context['journal_id'] = context.get('search_default_journal_id', False)
+ if not context.get('period_id', False):
+ context['period_id'] = context.get('search_default_period_id', False)
context = self.convert_to_period(cr, uid, context)
- #pass the right context when search_defaul_journal_id
- if context.get('search_default_journal_id',False):
- context['journal_id'] = context.get('search_default_journal_id')
+
# Compute simple values
data = super(account_move_line, self).default_get(cr, uid, fields, context=context)
- # Starts: Manual entry from account.move form
- if context.get('lines'):
- total_new = context.get('balance', 0.00)
- if context['journal']:
- journal_data = journal_obj.browse(cr, uid, context['journal'], context=context)
- if journal_data.type == 'purchase':
- if total_new > 0:
- account = journal_data.default_credit_account_id
- else:
- account = journal_data.default_debit_account_id
- else:
- if total_new > 0:
- account = journal_data.default_credit_account_id
- else:
- account = journal_data.default_debit_account_id
- if account and ((not fields) or ('debit' in fields) or ('credit' in fields)) and 'partner_id' in data and (data['partner_id']):
- part = partner_obj.browse(cr, uid, data['partner_id'], context=context)
- account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)
- account = account_obj.browse(cr, uid, account, context=context)
- data['account_id'] = account.id
-
- s = -total_new
- data['debit'] = s > 0 and s or 0.0
- data['credit'] = s < 0 and -s or 0.0
- data = self._default_get_move_form_hook(cr, uid, data)
- return data
- # Ends: Manual entry from account.move form
- if not 'move_id' in fields: #we are not in manual entry
- return data
- # Compute the current move
- move_id = False
- partner_id = False
- if context.get('journal_id', False) and context.get('period_id', False):
- if 'move_id' in fields:
- cr.execute('SELECT move_id \
- FROM \
- account_move_line \
- WHERE \
- journal_id = %s and period_id = %s AND create_uid = %s AND state = %s \
- ORDER BY id DESC limit 1',
- (context['journal_id'], context['period_id'], uid, 'draft'))
+ if context.get('journal_id'):
+ total = 0.0
+ #in account.move form view, it is not possible to compute total debit and credit using
+ #a browse record. So we must use the context to pass the whole one2many field and compute the total
+ if context.get('line_id'):
+ for move_line_dict in move_obj.resolve_2many_commands(cr, uid, 'line_id', context.get('line_id'), context=context):
+ data['name'] = data.get('name') or move_line_dict.get('name')
+ data['partner_id'] = data.get('partner_id') or move_line_dict.get('partner_id')
+ total += move_line_dict.get('debit', 0.0) - move_line_dict.get('credit', 0.0)
+ elif context.get('period_id'):
+ #find the date and the ID of the last unbalanced account.move encoded by the current user in that journal and period
+ move_id = False
+ cr.execute('''SELECT move_id, date FROM account_move_line
+ WHERE journal_id = %s AND period_id = %s AND create_uid = %s AND state = %s
+ ORDER BY id DESC limit 1''', (context['journal_id'], context['period_id'], uid, 'draft'))
res = cr.fetchone()
- move_id = (res and res[0]) or False
- if not move_id:
- return data
- else:
- data['move_id'] = move_id
- if 'date' in fields:
- cr.execute('SELECT date \
- FROM \
- account_move_line \
- WHERE \
- journal_id = %s AND period_id = %s AND create_uid = %s \
- ORDER BY id DESC',
- (context['journal_id'], context['period_id'], uid))
- res = cr.fetchone()
- if res:
- data['date'] = res[0]
- else:
- period = period_obj.browse(cr, uid, context['period_id'],
- context=context)
- data['date'] = period.date_start
- if not move_id:
- return data
- total = 0
- ref_id = False
- move = move_obj.browse(cr, uid, move_id, context=context)
- if 'name' in fields:
- data.setdefault('name', move.line_id[-1].name)
- acc1 = False
- for l in move.line_id:
- acc1 = l.account_id
- partner_id = partner_id or l.partner_id.id
- ref_id = ref_id or l.ref
- total += (l.debit or 0.0) - (l.credit or 0.0)
+ move_id = res and res[0] or False
+ data['date'] = res and res[1] or period_obj.browse(cr, uid, context['period_id'], context=context).date_start
+ data['move_id'] = move_id
+ if move_id:
+ #if there exist some unbalanced accounting entries that match the journal and the period,
+ #we propose to continue the same move by copying the ref, the name, the partner...
+ move = move_obj.browse(cr, uid, move_id, context=context)
+ data.setdefault('name', move.line_id[-1].name)
+ for l in move.line_id:
+ data['partner_id'] = data.get('partner_id') or l.partner_id.id
+ data['ref'] = data.get('ref') or l.ref
+ total += (l.debit or 0.0) - (l.credit or 0.0)
- if 'ref' in fields:
- data['ref'] = ref_id
- if 'partner_id' in fields:
- data['partner_id'] = partner_id
-
- if move.journal_id.type == 'purchase':
- if total > 0:
- account = move.journal_id.default_credit_account_id
- else:
- account = move.journal_id.default_debit_account_id
- else:
- if total > 0:
- account = move.journal_id.default_credit_account_id
- else:
- account = move.journal_id.default_debit_account_id
- part = partner_id and partner_obj.browse(cr, uid, partner_id) or False
- # part = False is acceptable for fiscal position.
- account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)
- if account:
- account = account_obj.browse(cr, uid, account, context=context)
-
- if account and ((not fields) or ('debit' in fields) or ('credit' in fields)):
- data['account_id'] = account.id
- # Propose the price Tax excluded, the Tax will be added when confirming line
- if account.tax_ids:
- taxes = fiscal_pos_obj.map_tax(cr, uid, part and part.property_account_position or False, account.tax_ids)
- tax = tax_obj.browse(cr, uid, taxes)
- for t in tax_obj.compute_inv(cr, uid, tax, total, 1):
- total -= t['amount']
-
- s = -total
- data['debit'] = s > 0 and s or 0.0
- data['credit'] = s < 0 and -s or 0.0
-
- if account and account.currency_id:
- data['currency_id'] = account.currency_id.id
- acc = account
- if s>0:
- acc = acc1
- compute_ctx = context.copy()
- compute_ctx.update({
- 'res.currency.compute.account': acc,
- 'res.currency.compute.account_invert': True,
- })
- v = currency_obj.compute(cr, uid, account.company_id.currency_id.id, data['currency_id'], s, context=compute_ctx)
- data['amount_currency'] = v
+ #compute the total of current move
+ data['debit'] = total < 0 and -total or 0.0
+ data['credit'] = total > 0 and total or 0.0
+ #pick the good account on the journal accordingly if the next proposed line will be a debit or a credit
+ journal_data = journal_obj.browse(cr, uid, context['journal_id'], context=context)
+ account = total > 0 and journal_data.default_credit_account_id or journal_data.default_debit_account_id
+ #map the account using the fiscal position of the partner, if needed
+ part = data.get('partner_id') and partner_obj.browse(cr, uid, data['partner_id'], context=context) or False
+ if account and data.get('partner_id'):
+ account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)
+ account = account_obj.browse(cr, uid, account, context=context)
+ data['account_id'] = account and account.id or False
+ #compute the amount in secondary currency of the account, if needed
+ if account and account.currency_id:
+ data['currency_id'] = account.currency_id.id
+ #set the context for the multi currency change
+ compute_ctx = context.copy()
+ compute_ctx.update({
+ #the following 2 parameters are used to choose the currency rate, in case where the account
+ #doesn't work with an outgoing currency rate method 'at date' but 'average'
+ 'res.currency.compute.account': account,
+ 'res.currency.compute.account_invert': True,
+ })
+ if data.get('date'):
+ compute_ctx.update({'date': data['date']})
+ data['amount_currency'] = currency_obj.compute(cr, uid, account.company_id.currency_id.id, data['currency_id'], -total, context=compute_ctx)
+ data = self._default_get_move_form_hook(cr, uid, data)
return data
def on_create_write(self, cr, uid, id, context=None):
@@ -688,6 +624,12 @@ class account_move_line(osv.osv):
}
return result
+ def onchange_account_id(self, cr, uid, ids, account_id, context=None):
+ res = {'value': {}}
+ if account_id:
+ res['value']['account_tax_id'] = [x.id for x in self.pool.get('account.account').browse(cr, uid, account_id, context=context).tax_ids]
+ return res
+
def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False):
partner_obj = self.pool.get('res.partner')
payment_term_obj = self.pool.get('account.payment.term')
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 0b6b23ecb82..0ca68f47e3c 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -998,7 +998,7 @@
-
+
@@ -1282,10 +1282,8 @@
-
+ context="{'line_id': line_id , 'journal_id': journal_id }">
-
diff --git a/addons/account/res_currency.py b/addons/account/res_currency.py
index ce781a1e11a..60bb6152a9b 100644
--- a/addons/account/res_currency.py
+++ b/addons/account/res_currency.py
@@ -29,6 +29,7 @@ class res_currency_account(osv.osv):
if context is None:
context = {}
rate = super(res_currency_account, self)._get_conversion_rate(cr, uid, from_currency, to_currency, context=context)
+ #process the case where the account doesn't work with an outgoing currency rate method 'at date' but 'average'
account = context.get('res.currency.compute.account')
account_invert = context.get('res.currency.compute.account_invert')
if account and account.currency_mode == 'average' and account.currency_id:
From 2c15e1882f73dd24560d3654954d938e62321133 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Fri, 23 Nov 2012 17:40:48 +0100
Subject: [PATCH 34/77] [FIX]Replace tree node by quickadd tree node
bzr revid: dle@openerp.com-20121123164048-8bm3ag313qyzs488
---
addons/account/account_view.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 0ca68f47e3c..fb8866b7fc1 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -990,7 +990,7 @@
account.move.line
-
+
@@ -1011,7 +1011,7 @@
-
+
From a64452b75e6d0bed9aeebafc986607ce7a9ebad2 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 26 Nov 2012 09:43:45 +0100
Subject: [PATCH 35/77] [TMP]Try to make invisibles working
bzr revid: dle@openerp.com-20121126084345-284vm5zyp4w12u8w
---
addons/account/static/src/js/account_move_line_quickadd.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 997b2b03bb6..47f5aeca7ec 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -45,8 +45,14 @@ openerp.account.quickadd = function (instance) {
self.current_period = result['period_id'];
self.current_journal = result['journal_id'];
});
+
return tmp;
},
+ load_view: function(context) {
+ debugger;
+ this.$el.parent().addClass("oe_view_manager_view_list");
+ return this._super.apply(this, arguments);
+ },
do_search: function(domain, context, group_by) {
var self = this;
this.last_domain = domain;
From b51841b842268a3d05c244aa5273c438a7810345 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 26 Nov 2012 16:01:24 +0100
Subject: [PATCH 36/77] [FIX]Back
bzr revid: dle@openerp.com-20121126150124-u5wf45ticx73gsip
---
addons/account/account_view.xml | 4 ++--
addons/account/static/src/js/account_move_line_quickadd.js | 6 ------
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index fb8866b7fc1..0ca68f47e3c 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -990,7 +990,7 @@
account.move.line
-
+
@@ -1011,7 +1011,7 @@
-
+
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 47f5aeca7ec..997b2b03bb6 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -45,14 +45,8 @@ openerp.account.quickadd = function (instance) {
self.current_period = result['period_id'];
self.current_journal = result['journal_id'];
});
-
return tmp;
},
- load_view: function(context) {
- debugger;
- this.$el.parent().addClass("oe_view_manager_view_list");
- return this._super.apply(this, arguments);
- },
do_search: function(domain, context, group_by) {
var self = this;
this.last_domain = domain;
From e046bb66504207f5ba4055553b7b1388227c0945 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Tue, 27 Nov 2012 11:04:18 +0100
Subject: [PATCH 37/77] [FIX]journal_id and period_id check wrong in _get_date
bzr revid: dle@openerp.com-20121127100418-iv8gkbh4r391qz6m
---
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 84de5548fce..e96853f572f 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -476,7 +476,7 @@ class account_move_line(osv.osv):
context or {}
period_obj = self.pool.get('account.period')
dt = time.strftime('%Y-%m-%d')
- if ('journal_id' in context) and ('period_id' in context):
+ if context.get('journal_id') and context.get('period_id'):
cr.execute('SELECT date FROM account_move_line ' \
'WHERE journal_id = %s AND period_id = %s ' \
'ORDER BY id DESC limit 1',
From e679e22547d638337658daa229dc15d5069f909e Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Tue, 27 Nov 2012 14:29:44 +0100
Subject: [PATCH 38/77] [FIX]Clean up account view
bzr revid: dle@openerp.com-20121127132944-kitr4nhl4rhy06e1
---
addons/account/account_view.xml | 535 ++++++++++++--------------------
1 file changed, 201 insertions(+), 334 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 0ca68f47e3c..39076b9c95c 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -2,10 +2,7 @@
-
-
+
account.fiscalyear.form
account.fiscalyear
@@ -70,7 +67,7 @@
-
+
Fiscal Years
account.fiscalyear
form
@@ -90,12 +87,9 @@
-
-
-
+
+
account.period.form
account.period
@@ -142,7 +136,6 @@
-
account.period.search
account.period
@@ -153,8 +146,7 @@
-
-
+
Periods
account.period
form
@@ -169,12 +161,9 @@
-
+
-
-
+
account.account.form
account.account
@@ -215,25 +204,6 @@
-
-
- account.account.search
- account.account
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
account.account.list
account.account
@@ -253,6 +223,23 @@
+
+ account.account.search
+ account.account
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Accounts
account.account
@@ -276,6 +263,20 @@
+
+
+
+
account.account.tree
account.account
@@ -301,7 +302,6 @@
[('parent_id','=',False)]
-
Unrealized Gain or Loss
account.account
@@ -321,7 +321,6 @@
-
Unrealized Gain or Loss
account.account
@@ -341,18 +340,31 @@
-
-
-
+
+ Journal Items
+ account.move.line
+ form
+ tree,form
+ {'search_default_account_id': [active_id]}
+
+
+ tree_but_open
+ account.account
+ Open Journal Items
+
+
+
+
account.journal.tree
account.journal
@@ -384,7 +396,6 @@
-
account.journal.form
account.journal
@@ -450,7 +461,6 @@
-
Journals
account.journal
@@ -471,6 +481,21 @@
+
+
+
+
+
account.cash.statement.select
account.bank.statement
@@ -656,9 +681,7 @@
-
+
account.account.type.search
account.account.type
@@ -668,7 +691,6 @@
-
account.account.type.tree
account.account.type
@@ -679,7 +701,6 @@
-
account.account.type.form
account.account.type
@@ -719,9 +740,8 @@
-
+
+
account.move.tree
account.move
@@ -739,10 +759,7 @@
-
-
+
account.move.reconcile.form
account.move.reconcile
@@ -761,9 +778,7 @@
-
+
account.tax.code.search
account.tax.code
@@ -834,13 +849,24 @@
-
-
+
+
+
+ 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
+
+
-
+
account.tax.tree
account.tax
@@ -962,59 +988,7 @@
-
-
-
- account.move.line
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- account.move.line.tree
- account.move.line
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
account.move.line.form
account.move.line
@@ -1084,7 +1058,6 @@
-
account.move.line.form2
account.move.line
@@ -1132,7 +1105,39 @@
+
+ account.move.line.tree
+ account.move.line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
account.move.line.graph
account.move.line
@@ -1144,7 +1149,6 @@
-
Journal Items
account.move.line
@@ -1173,7 +1177,6 @@
-
{'journal_type':'general'}
Journal Items
@@ -1193,7 +1196,6 @@
-
-
- Lines to reconcile
+
+ account.move.line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {'search_default_unreconciled': 1,'view_mode':True}
+ Journal Items to Reconcile
account.move.line
- form
- tree,form
- [('account_id.reconcile', '=', True),('reconcile_id','=',False)]
-
-
-
+
+ tree_account_reconciliation
+
+
+ No journal items found.
+
+
+
+
-
- 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
@@ -1374,7 +1388,6 @@
-
account.move.select
account.move
@@ -1399,7 +1412,6 @@
-
Journal Entries
account.move
@@ -1421,7 +1433,6 @@
-
-
-
-
- {'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
@@ -1521,10 +1483,7 @@
tree
-
-
+
account.model.line.tree
account.model.line
@@ -1541,8 +1500,6 @@
-
-
account.model.line.form
account.model.line
@@ -1562,7 +1519,6 @@
-
account.model.form
account.model
@@ -1581,7 +1537,6 @@
-
account.model.tree
account.model
@@ -1593,7 +1548,6 @@
-
account.model.search
account.model
@@ -1622,10 +1576,7 @@
action="action_model_form" id="menu_action_model_form" sequence="5"
parent="account.menu_configuration_misc"/>
-
-
+
account.payment.term.line.tree
account.payment.term.line
@@ -1640,8 +1591,6 @@
-
-
account.payment.term.line.form
account.payment.term.line
@@ -1681,7 +1630,6 @@
-
account.payment.term.search
account.payment.term
@@ -1692,7 +1640,6 @@
-
account.payment.term.form
account.payment.term
@@ -1708,7 +1655,6 @@
-
Payment Terms
account.payment.term
@@ -1719,10 +1665,7 @@
-
-
+
account.subscription.line.form
account.subscription.line
@@ -1735,7 +1678,6 @@
-
account.subscription.line.tree
account.subscription.line
@@ -1746,7 +1688,6 @@
-
account.subscription.tree
account.subscription
@@ -1760,7 +1701,6 @@
-
account.subscription.search
account.subscription
@@ -1778,7 +1718,6 @@
-
account.subscription.form
account.subscription
@@ -1864,63 +1803,7 @@
-
- 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
@@ -2001,7 +1867,6 @@
-
account.account.template.tree
account.account.template
@@ -2014,7 +1879,6 @@
-
account.account.template.search
account.account.template
@@ -2033,7 +1897,6 @@
-
Account Templates
account.account.template
@@ -2041,11 +1904,32 @@
tree,form
-
-
+
+ Create Account
+ account.addtmpl.wizard
+
+
+
+
+
+
+
+
account.chart.template.form
account.chart.template
@@ -2118,11 +2002,9 @@
form
tree,form
-
-
account.tax.template.form
account.tax.template
@@ -2201,7 +2083,6 @@
-
Tax Templates
account.tax.template
@@ -2209,7 +2090,6 @@
tree,form
-
@@ -2225,7 +2105,6 @@
-
account.tax.code.template.search
account.tax.code.template
@@ -2239,7 +2118,6 @@
-
account.tax.code.template.form
account.tax.code.template
@@ -2256,7 +2134,6 @@
-
Tax Code Templates
account.tax.code.template
@@ -2268,7 +2145,6 @@
-
Set Your Accounting Options
wizard.multi.charts.accounts
@@ -2307,7 +2183,6 @@
-
Set Your Accounting Options
ir.actions.act_window
@@ -2413,7 +2288,6 @@
-
account.bank.statement.form
account.bank.statement
@@ -2546,6 +2420,7 @@
+
tree
@@ -2575,10 +2450,7 @@
parent="menu_finance_payables"
action="base.action_partner_supplier_form" sequence="100"/>
-
-
+
account.financial.report.form
account.financial.report
@@ -2605,7 +2477,6 @@
-
account.financial.report.tree
account.financial.report
@@ -2618,7 +2489,6 @@
-
account.financial.report.search
account.financial.report
@@ -2634,7 +2504,6 @@
-
Financial Reports
ir.actions.act_window
@@ -2644,7 +2513,6 @@
-
@@ -2667,7 +2535,6 @@
[('parent_id','=',False)]
-
From 32d97b61480fdc2a0262b017496a23b016b6b82f Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Tue, 27 Nov 2012 15:56:14 +0100
Subject: [PATCH 39/77] [FIX]Move Line Tree View for wizard in module
account_payment
bzr revid: dle@openerp.com-20121127145614-1nx0paca73faa4bn
---
.../account_payment/account_payment_view.xml | 20 +++++--------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml
index 4d69c2d7315..740781b1a47 100644
--- a/addons/account_payment/account_payment_view.xml
+++ b/addons/account_payment/account_payment_view.xml
@@ -15,24 +15,14 @@
- account.move.line.tree
+ account.move.line.tree.wiz
account.move.line
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
From cdb615a936fb49b934346b6d73e3cb4b2b0a2bb8 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Tue, 27 Nov 2012 16:09:25 +0100
Subject: [PATCH 40/77] [FIX]Wrong tree
bzr revid: dle@openerp.com-20121127150925-yi8nv8d4jh0nd70y
---
addons/account_payment/account_payment_view.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml
index 740781b1a47..ae54f101731 100644
--- a/addons/account_payment/account_payment_view.xml
+++ b/addons/account_payment/account_payment_view.xml
@@ -15,12 +15,12 @@
- account.move.line.tree.wiz
+ account.move.line.tree
account.move.line
-
-
+
+
From 6a84219ee7cad5968ae56169679ead5cbbb5f381 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Tue, 27 Nov 2012 16:32:40 +0100
Subject: [PATCH 41/77] [FIX]Wrong tree
bzr revid: dle@openerp.com-20121127153240-8haso93pvh3y3aug
---
addons/account_payment/account_payment_view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml
index ae54f101731..6ee5847a515 100644
--- a/addons/account_payment/account_payment_view.xml
+++ b/addons/account_payment/account_payment_view.xml
@@ -20,7 +20,7 @@
-
+
From dc050b7a70f48f574e358c4a026f136503c463f9 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Tue, 27 Nov 2012 16:47:11 +0100
Subject: [PATCH 42/77] [FIX]Wrong tree
bzr revid: dle@openerp.com-20121127154711-c0rdp46gez107b0h
---
addons/account_payment/account_payment_view.xml | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml
index 6ee5847a515..8953ce53765 100644
--- a/addons/account_payment/account_payment_view.xml
+++ b/addons/account_payment/account_payment_view.xml
@@ -19,11 +19,9 @@
account.move.line
-
-
-
-
-
+
+
+
From 4b73ea9027106a8c91a24f37092e92ec6a2c3798 Mon Sep 17 00:00:00 2001
From: "dle@openerp.com" <>
Date: Wed, 28 Nov 2012 16:05:25 +0100
Subject: [PATCH 43/77] [FIX]Ir values actions
bzr revid: dle@openerp.com-20121128150525-zh27h78v8dd6dkwm
---
addons/account/account_view.xml | 44 +++++++++++----------------------
1 file changed, 14 insertions(+), 30 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 39076b9c95c..ae1b29aa2e2 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -349,19 +349,13 @@
-
- Journal Items
- account.move.line
- form
- tree,form
- {'search_default_account_id': [active_id]}
-
-
- tree_but_open
- account.account
- Open Journal Items
-
-
+
+
@@ -491,7 +485,7 @@
@@ -852,19 +846,12 @@
-
- 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
-
-
+
@@ -1131,10 +1118,8 @@
-
-
@@ -1183,7 +1168,6 @@
account.move.line
tree_account_move_line_quickadd
-
Select the period and the journal you want to fill.
From 92e87f7e6fa762af05b03a6a82d1e135f78172cb Mon Sep 17 00:00:00 2001
From: tsabi <>
Date: Thu, 29 Nov 2012 01:22:00 +0100
Subject: [PATCH 44/77] Mark strings to be translated. Maybe some missed, but
most of them marked.
bzr revid: tsabi-20121129002200-20tppzvh0ap5tfwe
---
addons/web/controllers/main.py | 23 +++++++------
addons/web/static/src/js/chrome.js | 34 +++++++++----------
addons/web/static/src/js/dates.js | 13 +++----
addons/web/static/src/js/formats.js | 14 ++++----
addons/web/static/src/js/view_form.js | 24 ++++++-------
addons/web/static/src/js/view_list.js | 14 ++++----
.../web/static/src/js/view_list_editable.js | 6 ++--
addons/web/static/src/js/views.js | 12 +++----
addons/web_calendar/static/src/js/calendar.js | 4 +--
addons/web_kanban/static/src/js/kanban.js | 2 +-
.../static/src/js/view_editor.js | 10 +++---
11 files changed, 80 insertions(+), 76 deletions(-)
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index e36b46ed51a..def93c16ea4 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -28,6 +28,7 @@ except ImportError:
xlwt = None
import openerp
+from openerp.tools.translate import _
from .. import http
from .. import nonliterals
@@ -821,7 +822,7 @@ class Database(openerpweb.Controller):
except xmlrpclib.Fault, e:
if e.faultCode and e.faultCode.split(':')[0] == 'AccessDenied':
return {'error': e.faultCode, 'title': 'Drop Database'}
- return {'error': 'Could not drop database !', 'title': 'Drop Database'}
+ return {'error': _('Could not drop database !'), 'title': _('Drop Database')}
@openerpweb.httprequest
def backup(self, req, backup_db, backup_pwd, token):
@@ -839,7 +840,7 @@ class Database(openerpweb.Controller):
{'fileToken': int(token)}
)
except xmlrpclib.Fault, e:
- return simplejson.dumps([[],[{'error': e.faultCode, 'title': 'backup Database'}]])
+ return simplejson.dumps([[],[{'error': e.faultCode, 'title': _('Backup Database')}]])
@openerpweb.httprequest
def restore(self, req, db_file, restore_pwd, new_db):
@@ -860,8 +861,8 @@ class Database(openerpweb.Controller):
return req.session.proxy("db").change_admin_password(old_password, new_password)
except xmlrpclib.Fault, e:
if e.faultCode and e.faultCode.split(':')[0] == 'AccessDenied':
- return {'error': e.faultCode, 'title': 'Change Password'}
- return {'error': 'Error, password not changed !', 'title': 'Change Password'}
+ return {'error': e.faultCode, 'title': _('Change Password')}
+ return {'error': _('Error, password not changed !'), 'title': _('Change Password')}
class Session(openerpweb.Controller):
_cp_path = "/web/session"
@@ -897,16 +898,16 @@ class Session(openerpweb.Controller):
old_password, new_password,confirm_password = operator.itemgetter('old_pwd', 'new_password','confirm_pwd')(
dict(map(operator.itemgetter('name', 'value'), fields)))
if not (old_password.strip() and new_password.strip() and confirm_password.strip()):
- return {'error':'You cannot leave any password empty.','title': 'Change Password'}
+ return {'error':_('You cannot leave any password empty.'),'title': _('Change Password')}
if new_password != confirm_password:
- return {'error': 'The new password and its confirmation must be identical.','title': 'Change Password'}
+ return {'error': _('The new password and its confirmation must be identical.'),'title': _('Change Password')}
try:
if req.session.model('res.users').change_password(
old_password, new_password):
return {'new_password':new_password}
except Exception:
- return {'error': 'The old password you provided is incorrect, your password was not changed.', 'title': 'Change Password'}
- return {'error': 'Error, password not changed !', 'title': 'Change Password'}
+ return {'error': _('The old password you provided is incorrect, your password was not changed.'), 'title': _('Change Password')}
+ return {'error': _('Error, password not changed !'), 'title': _('Change Password')}
@openerpweb.jsonrequest
def sc_list(self, req):
@@ -918,7 +919,7 @@ class Session(openerpweb.Controller):
try:
return req.session.proxy("db").list_lang() or []
except Exception, e:
- return {"error": e, "title": "Languages"}
+ return {"error": e, "title": _("Languages")}
@openerpweb.jsonrequest
def modules(self, req):
@@ -1450,7 +1451,7 @@ class SearchView(View):
if not isinstance(parsed_domain, nonliterals.BaseDomain)
else req.session.eval_domain(parsed_domain))
except Exception:
- logger.exception("Failed to parse custom filter %s in %s",
+ logger.exception(_("Failed to parse custom filter %s in %s"),
filter['name'], model)
filter['disabled'] = True
del filter['context']
@@ -1571,7 +1572,7 @@ class Binary(openerpweb.Controller):
res = Model.default_get(fields, context)
filecontent = base64.b64decode(res.get(field, ''))
if not filecontent:
- raise ValueError("No content found for field '%s' on '%s:%s'" %
+ raise ValueError(_("No content found for field '%s' on '%s:%s'") %
(field, model, id))
else:
filename = '%s_%s' % (model.replace('.', '_'), id)
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index 940bf800851..91cca8468d1 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -289,7 +289,7 @@ instance.web.CrashManager = instance.web.Class.extend({
});
instance.web.Loading = instance.web.Widget.extend({
- template: 'Loading',
+ template: _t("Loading"),
init: function(parent) {
this._super(parent);
this.count = 0;
@@ -390,11 +390,11 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
self.$el.find("form[name=restore_db_form]").validate({ submitHandler: self.do_restore });
self.$el.find("form[name=change_pwd_form]").validate({
messages: {
- old_pwd: "Please enter your previous password",
- new_pwd: "Please enter your new password",
+ old_pwd: _t("Please enter your previous password"),
+ new_pwd: _t("Please enter your new password"),
confirm_pwd: {
- required: "Please confirm your new password",
- equalTo: "The confirmation does not match the password"
+ required: _t("Please confirm your new password"),
+ equalTo: _t("The confirmation does not match the password")
}
},
submitHandler: self.do_change_password
@@ -478,7 +478,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
self.display_error(result);
return;
}
- self.do_notify("Duplicating database", "The database has been duplicated.");
+ self.do_notify(_t("Duplicating database"), _t("The database has been duplicated."));
self.start();
});
},
@@ -488,7 +488,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
fields = $form.serializeArray(),
$db_list = $form.find('[name=drop_db]'),
db = $db_list.val();
- if (!db || !confirm("Do you really want to delete the database: " + db + " ?")) {
+ if (!db || !confirm(_.str.sprintf(_t("Do you really want to delete the database: %s ?"), db))) {
return;
}
self.rpc("/web/database/drop", {'fields': fields}).done(function(result) {
@@ -496,7 +496,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
self.display_error(result);
return;
}
- self.do_notify("Dropping database", "The database '" + db + "' has been dropped");
+ self.do_notify(_t("Dropping database"), _.str.sprintf(_t("The database %s has been dropped"), db));
self.start();
});
},
@@ -511,7 +511,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
error: function(error){
if(error){
self.display_error({
- title: 'Backup Database',
+ title: _t("Backup Database"),
error: 'AccessDenied'
});
}
@@ -534,13 +534,13 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
if (body.indexOf('403 Forbidden') !== -1) {
self.display_error({
- title: 'Access Denied',
- error: 'Incorrect super-administrator password'
+ title: _t("Access Denied"),
+ error: _t("Incorrect super-administrator password")
});
} else {
self.display_error({
- title: 'Restore Database',
- error: 'Could not restore the database'
+ title: _t("Restore Database"),
+ error: _t("Could not restore the database")
});
}
},
@@ -560,7 +560,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
return;
}
self.unblockUI();
- self.do_notify("Changed Password", "Password has been changed successfully");
+ self.do_notify(_t("Changed Password"), _t("Password has been changed successfully"));
});
},
do_exit: function () {
@@ -642,7 +642,7 @@ instance.web.Login = instance.web.Widget.extend({
}
var db = this.$("form [name=db]").val();
if (!db) {
- this.do_warn("Login", "No database selected !");
+ this.do_warn(_t("Login"), _t("No database selected !"));
return false;
}
var login = this.$("form input[name=login]").val();
@@ -678,7 +678,7 @@ instance.web.Login = instance.web.Widget.extend({
self.trigger('login_successful');
}, function () {
self.$(".oe_login_pane").fadeIn("fast", function() {
- self.show_error("Invalid username or password");
+ self.show_error(_t("Invalid username or password"));
});
});
},
@@ -765,7 +765,7 @@ instance.web.ChangePassword = instance.web.Widget.extend({
template: "ChangePassword",
start: function() {
var self = this;
- this.getParent().dialog_title = "Change Password";
+ this.getParent().dialog_title = _t("Change Password");
var $button = self.$el.find('.oe_form_button');
$button.appendTo(this.getParent().$buttons);
$button.eq(2).click(function(){
diff --git a/addons/web/static/src/js/dates.js b/addons/web/static/src/js/dates.js
index 3db48c8412a..1a48463df2c 100644
--- a/addons/web/static/src/js/dates.js
+++ b/addons/web/static/src/js/dates.js
@@ -1,5 +1,6 @@
openerp.web.dates = function(instance) {
+var _t = instance.web._t;
/**
* Converts a string to a Date javascript object using OpenERP's
@@ -18,11 +19,11 @@ instance.web.str_to_datetime = function(str) {
var regex = /^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)(?:\.\d+)?$/;
var res = regex.exec(str);
if ( !res ) {
- throw new Error("'" + str + "' is not a valid datetime");
+ throw new Error(_.str.sprintf(_t("'%s' is not a valid datetime"), str));
}
var obj = Date.parseExact(res[1] + " UTC", 'yyyy-MM-dd HH:mm:ss zzz');
if (! obj) {
- throw new Error("'" + str + "' is not a valid datetime");
+ throw new Error(_.str.sprintf(_t("'%s' is not a valid datetime"), str));
}
return obj;
};
@@ -45,11 +46,11 @@ instance.web.str_to_date = function(str) {
var regex = /^\d\d\d\d-\d\d-\d\d$/;
var res = regex.exec(str);
if ( !res ) {
- throw new Error("'" + str + "' is not a valid date");
+ throw new Error(_.str.sprintf(_t("'%s' is not a valid date"), str));
}
var obj = Date.parseExact(str, 'yyyy-MM-dd');
if (! obj) {
- throw new Error("'" + str + "' is not a valid date");
+ throw new Error(_.str.sprintf(_t("'%s' is not a valid date"), str));
}
return obj;
};
@@ -72,11 +73,11 @@ instance.web.str_to_time = function(str) {
var regex = /^(\d\d:\d\d:\d\d)(?:\.\d+)?$/;
var res = regex.exec(str);
if ( !res ) {
- throw new Error("'" + str + "' is not a valid time");
+ throw new Error(_.str.sprintf(_t("'%s' is not a valid time"), str));
}
var obj = Date.parseExact("1970-01-01 " + res[1], 'yyyy-MM-dd HH:mm:ss');
if (! obj) {
- throw new Error("'" + str + "' is not a valid time");
+ throw new Error(_.str.sprintf(_t("'%s' is not a valid time"), str));
}
return obj;
};
diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js
index e586b94db6b..9432b02826f 100644
--- a/addons/web/static/src/js/formats.js
+++ b/addons/web/static/src/js/formats.js
@@ -224,7 +224,7 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) {
} while(tmp !== value);
tmp = Number(value);
if (isNaN(tmp))
- throw new Error(value + " is not a correct integer");
+ throw new Error(_.str.sprintf(_t("'%s' is not a correct integer"), value));
return tmp;
case 'float':
var tmp = Number(value);
@@ -239,7 +239,7 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) {
var reformatted_value = tmp.replace(instance.web._t.database.parameters.decimal_point, ".");
var parsed = Number(reformatted_value);
if (isNaN(parsed))
- throw new Error(value + " is not a correct float");
+ throw new Error(_.str.sprintf(_t("'%s' is not a correct float"), value));
return parsed;
case 'float_time':
var factor = 1;
@@ -263,7 +263,7 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) {
datetime = Date.parse(value);
if (datetime !== null)
return instance.web.datetime_to_str(datetime);
- throw new Error(value + " is not a valid datetime");
+ throw new Error(_.str.sprintf(_t("'%s' is not a correct datetime"), value));
case 'date':
var date = Date.parseExact(value, date_pattern);
if (date !== null)
@@ -271,7 +271,7 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) {
date = Date.parse(value);
if (date !== null)
return instance.web.date_to_str(date);
- throw new Error(value + " is not a valid date");
+ throw new Error(_.str.sprintf(_t("'%s' is not a correct date"), value));
case 'time':
var time = Date.parseExact(value, time_pattern);
if (time !== null)
@@ -279,7 +279,7 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) {
time = Date.parse(value);
if (time !== null)
return instance.web.time_to_str(time);
- throw new Error(value + " is not a valid time");
+ throw new Error(_.str.sprintf(_t("'%s' is not a correct time"), value));
}
return value;
};
@@ -294,7 +294,7 @@ instance.web.auto_str_to_date = function(value, type) {
try {
return instance.web.str_to_time(value);
} catch(e) {}
- throw new Error("'" + value + "' is not a valid date, datetime nor time");
+ throw new Error(_.str.sprintf(_t("'%s' is not a correct date, datetime nor time"), value));
};
instance.web.auto_date_to_str = function(value, type) {
@@ -306,7 +306,7 @@ instance.web.auto_date_to_str = function(value, type) {
case 'time':
return instance.web.time_to_str(value);
default:
- throw new Error(type + " is not convertible to date, datetime nor time");
+ throw new Error(_.str.sprintf(_t("'%s' is not convertible to date, datetime nor time"), type));
}
};
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 927d585a5be..dd9b2be5fb0 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -148,7 +148,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
load_form: function(data) {
var self = this;
if (!data) {
- throw new Error("No data provided.");
+ throw new Error(_t("No data provided."));
}
if (this.arch) {
throw "Form view does not support multiple calls to load_form";
@@ -316,12 +316,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
var self = this, set_values = [];
if (!record) {
this.set({ 'title' : undefined });
- this.do_warn("Form", "The record could not be found in the database.", true);
+ this.do_warn(_t("Form"), _t("The record could not be found in the database."), true);
return $.Deferred().reject();
}
this.datarecord = record;
this._actualize_mode();
- this.set({ 'title' : record.id ? record.display_name : "New" });
+ this.set({ 'title' : record.id ? record.display_name : _t("New") });
_(this.fields).each(function (field, f) {
field._dirty_flag = false;
@@ -431,7 +431,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
var onchange = _.str.trim(on_change);
var call = onchange.match(/^\s?(.*?)\((.*?)\)\s?$/);
if (!call) {
- throw new Error("Wrong on change format: " + onchange);
+ throw new Error(_.str.sprintf( _t("Wrong on change format: %s"), onchange ));
}
var method = call[1];
@@ -872,7 +872,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
}).value();
warnings.unshift('
');
- this.do_warn("The following fields are invalid :", warnings.join(''));
+ this.do_warn(_t("The following fields are invalid:", warnings.join(''));
},
/**
* Reload the form after saving
@@ -1241,11 +1241,11 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt
_.each(this.fields_to_init, function($elem) {
var name = $elem.attr("name");
if (!self.fvg.fields[name]) {
- throw new Error("Field '" + name + "' specified in view could not be found.");
+ throw new Error(_.str.sprintf(_t("Field '%s' specified in view could not be found."), name));
}
var obj = self.fields_registry.get_any([$elem.attr('widget'), self.fvg.fields[name].type]);
if (!obj) {
- throw new Error("Widget type '"+ $elem.attr('widget') + "' is not implemented");
+ throw new Error(_.str.sprintf(_t("Widget type '%s' is not implemented"), $elem.attr('widget')));
}
var w = new (obj)(self.view, instance.web.xml_to_json($elem[0]));
var $label = self.labels[$elem.attr("name")];
@@ -2319,7 +2319,7 @@ instance.web.form.FieldEmail = instance.web.form.FieldChar.extend({
},
on_button_clicked: function() {
if (!this.get('value') || !this.is_syntax_valid()) {
- this.do_warn("E-mail error", "Can't send email to invalid e-mail address");
+ this.do_warn(_t("E-mail error"), _t("Can't send email to invalid e-mail address"));
} else {
location.href = 'mailto:' + this.get('value');
}
@@ -2348,7 +2348,7 @@ instance.web.form.FieldUrl = instance.web.form.FieldChar.extend({
},
on_button_clicked: function() {
if (!this.get('value')) {
- this.do_warn("Resource error", "This resource is empty");
+ this.do_warn(_t("Resource error"), _t("This resource is empty"));
} else {
var url = $.trim(this.get('value'));
if(/^www\./i.test(url))
@@ -3385,7 +3385,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
var views = [];
_.each(modes, function(mode) {
if (! _.include(["list", "tree", "graph", "kanban"], mode)) {
- throw new Error(_.str.sprintf("View type '%s' is not supported in One2Many.", mode));
+ throw new Error(_.str.sprintf(_t("View type '%s' is not supported in One2Many."), mode));
}
var view = {
view_id: false,
@@ -4840,7 +4840,7 @@ instance.web.form.FieldBinary = instance.web.form.AbstractField.extend(instance.
},
on_file_uploaded: function(size, name, content_type, file_base64) {
if (size === false) {
- this.do_warn("File Upload", "There was a problem while uploading your file");
+ this.do_warn(_t("File Upload"), _t("There was a problem while uploading your file"));
// TODO: use openerp web crashmanager
console.warn("Error while uploading file : ", name);
} else {
@@ -5009,7 +5009,7 @@ instance.web.form.FieldMany2ManyBinaryMultiFiles = instance.web.form.AbstractFie
this.field_manager = field_manager;
this.node = node;
if(this.field.type != "many2many" || this.field.relation != 'ir.attachment') {
- throw "The type of the field '"+this.field.string+"' must be a many2many field with a relation to 'ir.attachment' model.";
+ throw _.str.sprintf(_t("The type of the field '%s' must be a many2many field with a relation to 'ir.attachment' model."), this.field.string);
}
this.ds_file = new instance.web.DataSetSearch(this, 'ir.attachment');
this.fileupload_id = _.uniqueId('oe_fileupload_temp');
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index 13c41d48599..5008d1765a6 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -389,7 +389,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
if (range_stop > total) {
range_stop = total;
}
- spager = _.str.sprintf('%d-%d of %d', range_start, range_stop, total);
+ spager = _.str.sprintf(_t("%d-%d of %d"), range_start, range_stop, total);
}
this.$pager.find('.oe_list_pager_state').text(spager);
@@ -887,8 +887,8 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
var $row;
if (attribute === 'id') {
if (old_value) {
- throw new Error("Setting 'id' attribute on existing record "
- + JSON.stringify(record.attributes));
+ throw new Error(_.str.sprintf( _t("Setting 'id' attribute on existing record %s"),
+ JSON.stringify(record.attributes) ));
}
if (!_.contains(self.dataset.ids, value)) {
// add record to dataset if not already in (added by
@@ -956,7 +956,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
if (row_id) {
e.stopPropagation();
if (!self.dataset.select_id(row_id)) {
- throw new Error("Could not find id in dataset");
+ throw new Error(_t("Could not find id in dataset"));
}
self.row_clicked(e);
}
@@ -1016,7 +1016,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
var command = value[0];
// 1. an array of m2m commands (usually (6, false, ids))
if (command[0] !== 6) {
- throw new Error(_t("Unknown m2m command ") + command[0]);
+ throw new Error(_.str.sprintf( _t("Unknown m2m command %s"), command[0]));
}
ids = command[2];
} else {
@@ -1324,7 +1324,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
}
// group_label is html-clean (through format or explicit
// escaping if format failed), can inject straight into HTML
- $group_column.html(_.str.sprintf("%s (%d)",
+ $group_column.html(_.str.sprintf(_t("%s (%d)"),
group_label, group.length));
if (group.length && group.openable) {
@@ -1743,7 +1743,7 @@ var Record = instance.web.Class.extend(/** @lends Record# */{
} else if (val instanceof Array) {
output[k] = val[0];
} else {
- throw new Error("Can't convert value " + val + " to context");
+ throw new Error(_.str.sprintf(_t("Can't convert value %s to context"), val));
}
}
return output;
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index 7fe6a8ec42b..e3f35e2068c 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -3,7 +3,9 @@
* @namespace
*/
openerp.web.list_editable = function (instance) {
- // editability status of list rows
+ var _t = instance.web._t;
+
+ // editability status of list rows
instance.web.ListView.prototype.defaults.editable = null;
// TODO: not sure second @lends on existing item is correct, to check
@@ -775,7 +777,7 @@ openerp.web.list_editable = function (instance) {
cancel: function (force) {
if (!(force || this.form.can_be_discarded())) {
return $.Deferred().reject({
- message: "The form's data can not be discarded"}).promise();
+ message: _t("The form's data can not be discarded")}).promise();
}
var record = this.record;
this.record = null;
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index ddedcdd2ff6..600a0b065c1 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -786,7 +786,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
break;
case 'tests':
this.do_action({
- name: "JS Tests",
+ name: _t("JS Tests"),
target: 'new',
type : 'ir.actions.act_url',
url: '/web/tests?mod=*'
@@ -814,7 +814,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
break;
case 'translate':
this.do_action({
- name: "Technical Translation",
+ name: _t("Technical Translation"),
res_model : 'ir.translation',
domain : [['type', '!=', 'object'], '|', ['name', '=', this.dataset.model], ['name', 'ilike', this.dataset.model + ',']],
views: [[false, 'list'], [false, 'form']],
@@ -1395,7 +1395,7 @@ instance.web.json_node_to_xml = function(node, human_readable, indent) {
return sindent + node;
} else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
throw new Error(
- _.str.sprintf("Node [%s] is not a JSONified XML node",
+ _.str.sprintf(_t("Node [%s] is not a JSONified XML node"),
JSON.stringify(node)));
}
for (var attr in node.attrs) {
@@ -1429,7 +1429,7 @@ instance.web.xml_to_str = function(node) {
} else if (window.ActiveXObject) {
return node.xml;
} else {
- throw new Error("Could not serialize XML");
+ throw new Error(_t("Could not serialize XML"));
}
};
instance.web.str_to_xml = function(s) {
@@ -1437,7 +1437,7 @@ instance.web.str_to_xml = function(s) {
var dp = new DOMParser();
var r = dp.parseFromString(s, "text/xml");
if (r.body && r.body.firstChild && r.body.firstChild.nodeName == 'parsererror') {
- throw new Error("Could not parse string to xml");
+ throw new Error(_t("Could not parse string to xml"));
}
return r;
}
@@ -1445,7 +1445,7 @@ instance.web.str_to_xml = function(s) {
try {
xDoc = new ActiveXObject("MSXML2.DOMDocument");
} catch (e) {
- throw new Error("Could not find a DOM Parser: " + e.message);
+ throw new Error(_.str.sprintf( _t("Could not find a DOM Parser: %s"), e.message));
}
xDoc.async = false;
xDoc.preserveWhiteSpace = true;
diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js
index 5fd9b6677a0..46d25e749a2 100644
--- a/addons/web_calendar/static/src/js/calendar.js
+++ b/addons/web_calendar/static/src/js/calendar.js
@@ -88,7 +88,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
this.fields = this.fields_view.fields;
if (!this.date_start) {
- throw new Error("Calendar view has not defined 'date_start' attribute.");
+ throw new Error(_t("Calendar view has not defined 'date_start' attribute."));
}
//* Calendar Fields *
@@ -96,7 +96,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
if (this.date_delay) {
if (this.fields[this.date_delay].type != 'float') {
- throw new Error("Calendar view has a 'date_delay' type != float");
+ throw new Error(_t("Calendar view has a 'date_delay' type != float"));
}
this.calendar_fields.date_delay = {'name': this.date_delay, 'kind': this.fields[this.date_delay].type};
}
diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js
index 4e9157e1d75..c93d7d333e4 100644
--- a/addons/web_kanban/static/src/js/kanban.js
+++ b/addons/web_kanban/static/src/js/kanban.js
@@ -409,7 +409,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
new_group.do_save_sequences();
}).fail(function(error, evt) {
evt.preventDefault();
- alert("An error has occured while moving the record to this group.");
+ alert(_t("An error has occured while moving the record to this group."));
self.do_reload(); // TODO: use draggable + sortable in order to cancel the dragging when the rcp fails
});
}
diff --git a/addons/web_view_editor/static/src/js/view_editor.js b/addons/web_view_editor/static/src/js/view_editor.js
index a844c0f3be8..6b70914f332 100644
--- a/addons/web_view_editor/static/src/js/view_editor.js
+++ b/addons/web_view_editor/static/src/js/view_editor.js
@@ -161,7 +161,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
}
});
msg += "";
- this.do_warn("The following fields are invalid :", msg);
+ this.do_warn(_t("The following fields are invalid :"), msg);
},
add_node_name : function(node) {
if(node.tagName.toLowerCase() == "button" || node.tagName.toLowerCase() == "field"){
@@ -260,7 +260,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
"arch": view_arch_list});
});
} else {
- self.do_warn("Please select view in list :");
+ self.do_warn(_t("Please select view in list :"));
}
});
},
@@ -387,10 +387,10 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
self.inherited_view(selected_row);
}
}else{
- alert("Can't Update View");
+ alert(_t("Can't Update View"));
}
}else{
- alert("Select an element");
+ alert(_t("Select an element"));
}
}},
{text: _t("Preview"), click: function() {
@@ -983,7 +983,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
} else {
table_selector.append('' + node.string + ' | ' + type_widget.render() );
if (node.name == "field_value") {
- table_selector.append(' | ');
+ table_selector.append(' | ');
}
}
type_widget.start();
From e2435d4f004a20636aef8a8ee2cc03c8cfc3e78c Mon Sep 17 00:00:00 2001
From: tsabi <>
Date: Thu, 29 Nov 2012 02:18:22 +0100
Subject: [PATCH 45/77] fixed a typo that maked javascript error
bzr revid: tsabi-20121129011822-fv9v0l72231y0093
---
addons/web/static/src/js/view_form.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index dd9b2be5fb0..06c1a3d989b 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -872,7 +872,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
}).value();
warnings.unshift('');
- this.do_warn(_t("The following fields are invalid:", warnings.join(''));
+ this.do_warn(_t("The following fields are invalid:"), warnings.join(''));
},
/**
* Reload the form after saving
From 7a50367e840ac4eedd195e8682d20387178cac35 Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 11:12:28 +0100
Subject: [PATCH 46/77] [IMP] account: optimized the account invoice analysis
report to lower the response time. Removed the fields due_delay and
delay_to_pay that were the reasons of the bad performances besides being a
bit useless and having wrong values computed
bzr revid: qdp-launchpad@openerp.com-20121129101228-6cxv07svxnbabfr0
---
addons/account/account_invoice.py | 4 +-
.../account/report/account_invoice_report.py | 219 +++++++-----------
.../report/account_invoice_report_view.xml | 4 +-
addons/product/product.py | 2 +-
4 files changed, 93 insertions(+), 136 deletions(-)
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 6804d5116f1..8d13ec9dc8f 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -1381,8 +1381,8 @@ class account_invoice_line(osv.osv):
'origin': fields.char('Source Document', size=256, help="Reference of the document that produced this invoice."),
'sequence': fields.integer('Sequence', help="Gives the sequence of this line when displaying the invoice."),
'invoice_id': fields.many2one('account.invoice', 'Invoice Reference', ondelete='cascade', select=True),
- 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null'),
- 'product_id': fields.many2one('product.product', 'Product', ondelete='set null'),
+ 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null', select=True),
+ 'product_id': fields.many2one('product.product', 'Product', ondelete='set null', select=True),
'account_id': fields.many2one('account.account', 'Account', required=True, domain=[('type','<>','view'), ('type', '<>', 'closed')], help="The income or expense account related to the selected product."),
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')),
'price_subtotal': fields.function(_amount_line, string='Subtotal', type="float",
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 68eaedb20a6..d1f78ab7b0f 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -98,150 +98,109 @@ class account_invoice_report(osv.osv):
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
'residual': fields.float('Total Residual', readonly=True),
'user_currency_residual': fields.function(_compute_amounts_in_user_currency, string="Total Residual", type='float', digits_compute=dp.get_precision('Account'), multi="_compute_amounts"),
- 'delay_to_pay': fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
- 'due_delay': fields.float('Avg. Due Delay', readonly=True, group_operator="avg"),
}
_order = 'date desc'
def _select(self):
select_str = """
- SELECT min(ail.id) as id,
- ai.date_invoice as date,
- to_char(ai.date_invoice, 'YYYY') as year,
- to_char(ai.date_invoice, 'MM') as month,
- to_char(ai.date_invoice, 'YYYY-MM-DD') as day,
- ail.product_id,
- ai.partner_id as partner_id,
- ai.payment_term as payment_term,
- ai.period_id as period_id,
- (case when u.uom_type not in ('reference') then
- (select name from product_uom where uom_type='reference' and active and category_id=u.category_id LIMIT 1)
- else
- u.name
- end) as uom_name,
- ai.currency_id as currency_id,
- ai.journal_id as journal_id,
- ai.fiscal_position as fiscal_position,
- ai.user_id as user_id,
- ai.company_id as company_id,
- count(ail.*) as nbr,
- ai.type as type,
- ai.state,
- pt.categ_id,
- ai.date_due as date_due,
- ai.account_id as account_id,
- ail.account_id as account_line_id,
- ai.partner_bank_id as partner_bank_id,
- sum(case when ai.type in ('out_refund','in_invoice') then
- -ail.quantity / u.factor
- else
- ail.quantity / u.factor
- end) as product_qty,
-
- sum(case when ai.type in ('out_refund','in_invoice') then
- -ail.price_subtotal
- else
- ail.price_subtotal
- end) / cr.rate as price_total,
-
- (case when ai.type in ('out_refund','in_invoice') then
- sum(-ail.price_subtotal)
- else
- sum(ail.price_subtotal)
- end) / (CASE WHEN sum(ail.quantity/u.factor) <> 0
- THEN
- (case when ai.type in ('out_refund','in_invoice')
- then sum(-ail.quantity/u.factor)
- else sum(ail.quantity/u.factor) end)
- ELSE 1
- END)
- / cr.rate as price_average,
-
- cr.rate as currency_rate,
- sum((select extract(epoch from avg(date_trunc('day',aml.date_created)-date_trunc('day',l.create_date)))/(24*60*60)::decimal(16,2)
- from account_move_line as aml
- left join account_invoice as a ON (a.move_id=aml.move_id)
- left join account_invoice_line as l ON (a.id=l.invoice_id)
- where a.id=ai.id)) as delay_to_pay,
- sum((select extract(epoch from avg(date_trunc('day',a.date_due)-date_trunc('day',a.date_invoice)))/(24*60*60)::decimal(16,2)
- from account_move_line as aml
- left join account_invoice as a ON (a.move_id=aml.move_id)
- left join account_invoice_line as l ON (a.id=l.invoice_id)
- where a.id=ai.id)) as due_delay,
- (case when ai.type in ('out_refund','in_invoice') then
- -ai.residual
- else
- ai.residual
- end)/ (CASE WHEN
- (select count(l.id) from account_invoice_line as l
- left join account_invoice as a ON (a.id=l.invoice_id)
- where a.id=ai.id) <> 0
- THEN
- (select count(l.id) from account_invoice_line as l
- left join account_invoice as a ON (a.id=l.invoice_id)
- where a.id=ai.id)
- ELSE 1
- END) / cr.rate as residual
+ SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id,
+ sub.payment_term, sub.period_id, sub.uom_name, sub.currency_id, sub.journal_id,
+ sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state,
+ sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id,
+ sub.product_qty, sub.price_total / cr.rate as price_total, sub.price_average /cr.rate as price_average,
+ cr.rate as currency_rate, sub.residual / cr.rate as residual, sub.section_id
+ FROM (
+ SELECT min(ail.id) AS id,
+ ai.date_invoice AS date,
+ to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text) AS year,
+ to_char(ai.date_invoice::timestamp with time zone, 'MM'::text) AS month,
+ to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text) AS day,
+ ail.product_id, ai.partner_id, ai.payment_term, ai.period_id,
+ CASE
+ WHEN u.uom_type::text <> 'reference'::text
+ THEN ( SELECT product_uom.name
+ FROM product_uom
+ WHERE product_uom.uom_type::text = 'reference'::text
+ AND product_uom.active
+ AND product_uom.category_id = u.category_id LIMIT 1)
+ ELSE u.name
+ END AS uom_name,
+ ai.currency_id, ai.journal_id, ai.fiscal_position, ai.user_id, ai.company_id,
+ count(ail.*) AS nbr,
+ ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id,
+ ai.partner_bank_id,
+ SUM(CASE
+ WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text])
+ THEN (- ail.quantity) / u.factor
+ ELSE ail.quantity / u.factor
+ END) AS product_qty,
+ SUM(CASE
+ WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text])
+ THEN - ail.price_subtotal
+ ELSE ail.price_subtotal
+ END) AS price_total,
+ CASE
+ WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text])
+ THEN SUM(- ail.price_subtotal)
+ ELSE SUM(ail.price_subtotal)
+ END / CASE
+ WHEN SUM(ail.quantity / u.factor) <> 0::numeric
+ THEN CASE
+ WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text])
+ THEN SUM((- ail.quantity) / u.factor)
+ ELSE SUM(ail.quantity / u.factor)
+ END
+ ELSE 1::numeric
+ END AS price_average,
+ CASE
+ WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text])
+ THEN - ai.residual
+ ELSE ai.residual
+ END / CASE
+ WHEN (( SELECT count(l.id) AS count
+ FROM account_invoice_line l
+ LEFT JOIN account_invoice a ON a.id = l.invoice_id
+ WHERE a.id = ai.id)) <> 0
+ THEN ( SELECT count(l.id) AS count
+ FROM account_invoice_line l
+ LEFT JOIN account_invoice a ON a.id = l.invoice_id
+ WHERE a.id = ai.id)
+ ELSE 1::bigint
+ END::numeric AS residual,
+ ai.section_id
+ FROM account_invoice_line ail
+ JOIN account_invoice ai ON ai.id = ail.invoice_id
+ LEFT JOIN product_product pr ON pr.id = ail.product_id
+ left JOIN product_template pt ON pt.id = pr.product_tmpl_id
+ LEFT JOIN product_uom u ON u.id = ail.uos_id
+ GROUP BY ail.product_id, ai.date_invoice, ai.id,
+ to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text),
+ to_char(ai.date_invoice::timestamp with time zone, 'MM'::text),
+ to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text),
+ ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,
+ ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id,
+ ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual,
+ ai.amount_total, u.uom_type, u.category_id, ai.section_id
+ ) AS sub
+ JOIN res_currency_rate cr ON (cr.currency_id = sub.currency_id)
+ WHERE
+ cr.id IN (SELECT id
+ FROM res_currency_rate cr2
+ WHERE (cr2.currency_id = sub.currency_id)
+ AND ((sub.date IS NOT NULL AND cr.name <= sub.date)
+ OR (sub.date IS NULL AND cr.name <= NOW()))
+ ORDER BY name DESC LIMIT 1);
"""
return select_str
- def _where(self):
- where_str = """
- WHERE cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id)
- and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) order by name desc limit 1)
- """
- return where_str
-
- def _from(self):
- from_str = """
- FROM account_invoice_line as ail
- left join account_invoice as ai ON (ai.id=ail.invoice_id)
- left join product_product pr on (pr.id=ail.product_id)
- left join product_template pt on (pt.id=pr.product_tmpl_id)
- left join product_uom u on (u.id=ail.uos_id),
- res_currency_rate cr
- """
- return from_str
-
- def _group_by(self):
- group_by_str = """
- GROUP BY ail.product_id,
- ai.date_invoice,
- ai.id,
- cr.rate,
- to_char(ai.date_invoice, 'YYYY'),
- to_char(ai.date_invoice, 'MM'),
- to_char(ai.date_invoice, 'YYYY-MM-DD'),
- ai.partner_id,
- ai.payment_term,
- ai.period_id,
- u.name,
- ai.currency_id,
- ai.journal_id,
- ai.fiscal_position,
- ai.user_id,
- ai.company_id,
- ai.type,
- ai.state,
- pt.categ_id,
- ai.date_due,
- ai.account_id,
- ail.account_id,
- ai.partner_bank_id,
- ai.residual,
- ai.amount_total,
- u.uom_type,
- u.category_id
- """
- return group_by_str
def init(self, cr):
# self._table = account_invoice_report
tools.drop_view_if_exists(cr, self._table)
- cr.execute("CREATE or REPLACE VIEW %s as (%s %s %s %s)" % (
+ cr.execute("CREATE or REPLACE VIEW %s as (%s %s)" % (
self._table,
- self._select(), self._from(), self._where(), self._group_by()))
+ self._select()))
account_invoice_report()
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 289db376e5d..66e17560bde 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -30,8 +30,6 @@
-
-
@@ -93,7 +91,7 @@
tree,graph
{'search_default_period':1,'search_default_current':1, 'search_default_year': 1, 'search_default_category_product':1, 'search_default_customer':1, 'group_by':[], 'group_by_no_leaf':1,}
- From this report, you can have an overview of the amount invoiced to your customer as well as payment delays. The tool search can also be used to personalise your Invoices reports and so, match this analysis to your needs.
+ From this report, you can have an overview of the amount invoiced to your customer. The tool search can also be used to personalise your Invoices reports and so, match this analysis to your needs.
diff --git a/addons/product/product.py b/addons/product/product.py
index 1333c9581a7..fb28f85b10f 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -546,7 +546,7 @@ class product_product(osv.osv):
'default_code' : fields.char('Internal Reference', size=64, select=True),
'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the product without removing it."),
'variants': fields.char('Variants', size=64),
- 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"),
+ 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade", select=True),
'ean13': fields.char('EAN13 Barcode', size=13, help="International Article Number used for product identification."),
'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Product Price')),
From fa7db1d68b62fb3b6b3fc1ec37851245942f41d3 Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 12:22:29 +0100
Subject: [PATCH 47/77] [IMP] crm: optimized the crm lead analysis report to
lower the response time. Removed the field email that was the reason of the
bad performances besides being a bit useless
bzr revid: qdp-launchpad@openerp.com-20121129112229-b4n9cb23b7e10n41
---
addons/crm/report/crm_lead_report.py | 2 --
addons/crm/report/crm_lead_report_view.xml | 4 +---
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index da5167da1e6..25598abc3ea 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -81,7 +81,6 @@ class crm_lead_report(osv.osv):
'type_id':fields.many2one('crm.case.resource.type', 'Campaign', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
- 'email': fields.integer('# Emails', size=128, readonly=True),
'probability': fields.float('Probability',digits=(16,2),readonly=True, group_operator="avg"),
'planned_revenue': fields.float('Planned Revenue',digits=(16,2),readonly=True),
'probable_revenue': fields.float('Probable Revenue', digits=(16,2),readonly=True),
@@ -137,7 +136,6 @@ class crm_lead_report(osv.osv):
c.planned_revenue,
c.planned_revenue*(c.probability/100) as probable_revenue,
1 as nbr,
- (SELECT count(id) FROM mail_message WHERE model='crm.lead' AND res_id=c.id AND email_from is not null) AS email,
date_trunc('day',c.create_date) as create_date,
extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as delay_close,
abs(extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24)) as delay_expected,
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index a17633d0ef6..0e5df8837f1 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -25,7 +25,6 @@
-
@@ -148,7 +147,6 @@
-
@@ -167,7 +165,7 @@
{'search_default_year': 1,'search_default_lead': 1, "search_default_user":1, "search_default_this_month":1, 'group_by_no_leaf':1, 'group_by':[]}
tree,graph
[]
- Leads Analysis allows you to check different CRM related information. Check for treatment delays, number of responses given and emails sent. You can sort out your leads analysis by different groups to get accurate grained analysis.
+ Leads Analysis allows you to check different CRM related information like the treatment delays or number of leads per state. You can sort out your leads analysis by different groups to get accurate grained analysis.
From 72109e7541c1748e066ff4fe8b60a3cfa052d247 Mon Sep 17 00:00:00 2001
From: tsabi
Date: Thu, 29 Nov 2012 12:53:06 +0100
Subject: [PATCH 48/77] fix tab problem
bzr revid: csaba.toth@i3rendszerhaz.hu-20121129115306-ifncjymnmuk989eq
---
addons/web/static/src/js/view_list_editable.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index e3f35e2068c..17f757d4e72 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -3,9 +3,9 @@
* @namespace
*/
openerp.web.list_editable = function (instance) {
- var _t = instance.web._t;
+ var _t = instance.web._t;
- // editability status of list rows
+ // editability status of list rows
instance.web.ListView.prototype.defaults.editable = null;
// TODO: not sure second @lends on existing item is correct, to check
From 83b7823f257b17403a11908c9b359244635cf0b7 Mon Sep 17 00:00:00 2001
From: tsabi
Date: Thu, 29 Nov 2012 12:54:54 +0100
Subject: [PATCH 49/77] some more change in the new pyeval.js file
bzr revid: csaba.toth@i3rendszerhaz.hu-20121129115454-rpviywfnosjdmovm
---
addons/web/static/src/js/pyeval.js | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/addons/web/static/src/js/pyeval.js b/addons/web/static/src/js/pyeval.js
index 265449f9f64..417459b3a63 100644
--- a/addons/web/static/src/js/pyeval.js
+++ b/addons/web/static/src/js/pyeval.js
@@ -2,6 +2,7 @@
* py.js helpers and setup
*/
openerp.web.pyeval = function (instance) {
+ var _t = instance.web._t;
instance.web.pyeval = {};
var obj = function () {};
@@ -71,7 +72,7 @@ openerp.web.pyeval = function (instance) {
var ymd2ord = function (year, month, day) {
var dim = days_in_month(year, month);
if (!(1 <= day && day <= dim)) {
- throw new Error("ValueError: day must be in 1.." + dim);
+ throw new Error(_.str.sprintf(_t("ValueError: day must be in 1..%d"), dim));
}
return days_before_year(year)
+ days_before_month(year, month)
@@ -277,10 +278,11 @@ openerp.web.pyeval = function (instance) {
});
var s = _.str.sprintf("%d:%02d:%02d", hh, mm, ss);
if (this.days) {
- s = _.str.sprintf("%d day%s, %s",
- this.days,
- (this.days != 1 && this.days != -1) ? 's' : '',
- s);
+ if (this.days != 1 && this.days != -1) {
+ s = _.str.sprintf(_t("%d days, %s"), this.days, s);
+ } else {
+ s = _.str.sprintf(_t("%d day, %s"), this.days, s);
+ };
}
if (this.microseconds) {
s = _.str.sprintf("%s.%06d", s, this.microseconds);
@@ -726,7 +728,7 @@ openerp.web.pyeval = function (instance) {
case 'context': case 'compound_context':
return instance.web.pyeval.eval('contexts', [arg]);
default:
- throw new Error(instance.web._t("Unknown nonliteral type " + arg.__ref));
+ throw new Error(_t("Unknown nonliteral type ") + arg.__ref);
}
};
/**
@@ -760,11 +762,11 @@ openerp.web.pyeval = function (instance) {
} catch (e) {
d.resolve({ error: {
code: 400,
- message: instance.web._t("Evaluation Error"),
+ message: _t("Evaluation Error"),
data: {
type: 'local_exception',
debug: _.str.sprintf(
- instance.web._t("Local evaluation failure\n%s\n\n%s"),
+ _t("Local evaluation failure\n%s\n\n%s"),
e.message, JSON.stringify(source))
}
}});
From 7bfab22e1f6699890d79512f2b7f8ac486fa52f0 Mon Sep 17 00:00:00 2001
From: Fabien Meghazi
Date: Thu, 29 Nov 2012 13:07:38 +0100
Subject: [PATCH 50/77] [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 b6997b7c74c4c90070439515bbbb666cda94988c Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 14:03:46 +0100
Subject: [PATCH 51/77] [FIX] account: not enough argument given during format
string
bzr revid: qdp-launchpad@openerp.com-20121129130346-ewydqj74l8h9qrby
---
addons/account/report/account_invoice_report.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index d1f78ab7b0f..48f9022a8dc 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -198,7 +198,7 @@ class account_invoice_report(osv.osv):
def init(self, cr):
# self._table = account_invoice_report
tools.drop_view_if_exists(cr, self._table)
- cr.execute("CREATE or REPLACE VIEW %s as (%s %s)" % (
+ cr.execute("CREATE or REPLACE VIEW %s as (%s)" % (
self._table,
self._select()))
From bd61641572949ab2c9b1a07267cd7d7344d17a7d Mon Sep 17 00:00:00 2001
From: Fabien Pinckaers
Date: Thu, 29 Nov 2012 14:06:55 +0100
Subject: [PATCH 52/77] [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 9f76458404ff3d99824149d09121952c4f2fc775 Mon Sep 17 00:00:00 2001
From: Xavier Morel
Date: Thu, 29 Nov 2012 14:13:01 +0100
Subject: [PATCH 53/77] [FIX] groupby on editable list
Because of the "meta" columns (e.g. group name column),
ListView#columns would end up with a different number of elements than
ListView#fields_view.arch.children, and when zipping them together (to
build the form view for edition) things wouldn't match anymore.
It would seem simply filtering out meta columns (and only keep those
actually specified by the view) is sufficient to fix the issue and
have everything line up again. I'm midly impressed.
bzr revid: xmo@openerp.com-20121129131301-scc38i4l55ea7lis
---
addons/web/static/src/js/view_list_editable.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index 7fe6a8ec42b..79b91a41b3c 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -383,7 +383,8 @@ openerp.web.list_editable = function (instance) {
version: '7.0'
});
_(view.arch.children).chain()
- .zip(this.columns)
+ .zip(_(this.columns).filter(function (c) {
+ return !(c instanceof instance.web.list.MetaColumn);}))
.each(function (ar) {
var widget = ar[0], column = ar[1];
var modifiers = _.extend({}, column.modifiers);
From 8cc5780e5866f9ecaa1484a9f0c540383e018148 Mon Sep 17 00:00:00 2001
From: "dle@openerp.com" <>
Date: Thu, 29 Nov 2012 14:13:17 +0100
Subject: [PATCH 54/77] [FIX]More links
bzr revid: dle@openerp.com-20121129131317-0s1rru4pxjn0lzl3
---
addons/account/account_view.xml | 18 ++++--------------
.../account_followup/account_followup_view.xml | 4 ++--
.../account_payment/account_payment_view.xml | 4 ++--
3 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 29b5f074fc9..6f099e4b824 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -346,16 +346,6 @@
groups="account.group_account_user"
id="menu_unrealized_gains_losses"
parent="account.menu_multi_currency"/>
-
-
-
@@ -485,7 +475,7 @@
@@ -1118,8 +1108,8 @@
-
-
+
@@ -1438,7 +1428,7 @@
-
+
account.move.line.tree.followup
diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml
index 8953ce53765..e07043c495a 100644
--- a/addons/account_payment/account_payment_view.xml
+++ b/addons/account_payment/account_payment_view.xml
@@ -14,7 +14,7 @@
-
+
From 759f11f11077514bbf5e45ffa88a69ec1d0066ef Mon Sep 17 00:00:00 2001
From: Xavier Morel
Date: Thu, 29 Nov 2012 14:27:38 +0100
Subject: [PATCH 55/77] [FIX] py.js: bug in tokenization of single-quoted empty
string
bzr revid: xmo@openerp.com-20121129132738-fcnam8bkqyt7h8ey
---
addons/web/static/lib/py.js/.hg_archival.txt | 4 ++--
addons/web/static/lib/py.js/lib/py.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/addons/web/static/lib/py.js/.hg_archival.txt b/addons/web/static/lib/py.js/.hg_archival.txt
index 33dcdd88830..771b798ac84 100644
--- a/addons/web/static/lib/py.js/.hg_archival.txt
+++ b/addons/web/static/lib/py.js/.hg_archival.txt
@@ -1,5 +1,5 @@
repo: 076b192d0d8ab2b92d1dbcfa3da055382f30eaea
-node: ccf62e5d0291f66a39f4049f3e880004e59c3654
+node: 2b62048dd1d86c45e4bf0442b5da4122534132bf
branch: default
latesttag: 0.7
-latesttagdistance: 4
+latesttagdistance: 5
diff --git a/addons/web/static/lib/py.js/lib/py.js b/addons/web/static/lib/py.js/lib/py.js
index 854232a0d80..04ecd3aeb5c 100644
--- a/addons/web/static/lib/py.js/lib/py.js
+++ b/addons/web/static/lib/py.js/lib/py.js
@@ -311,7 +311,7 @@ var py = {};
} else if (string_pattern.test(token)) {
var m = string_pattern.exec(token);
tokens.push(create(symbols['(string)'], {
- value: m[2] || m[3]
+ value: (m[2] !== undefined ? m[2] : m[3])
}));
} else if (token in symbols) {
var symbol;
From 184593003b3aec7d40660ae13002f4a4a205fa12 Mon Sep 17 00:00:00 2001
From: niv-openerp
Date: Thu, 29 Nov 2012 14:40:51 +0100
Subject: [PATCH 56/77] [FIX] race condition problem with m2m
bzr revid: nicolas.vanhoren@openerp.com-20121129134051-5hiw9z5hi99fxtve
---
addons/web/static/src/js/view_form.js | 76 ++++++++++++---------------
1 file changed, 35 insertions(+), 41 deletions(-)
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 49f4e30815f..ad5fcdd29d8 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -4069,13 +4069,12 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
If you see this options, do not use it, it's basically a dirty hack to make one
precise o2m to behave the way we want.
*/
-instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
+instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, {
multi_selection: false,
disable_utility_classes: true,
init: function(field_manager, node) {
this._super(field_manager, node);
this.is_loaded = $.Deferred();
- this.initial_is_loaded = this.is_loaded;
this.dataset = new instance.web.form.Many2ManyDataSet(this, this.field.relation);
this.dataset.m2m = this;
var self = this;
@@ -4083,24 +4082,44 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
self.dataset_changed();
});
this.set_value([]);
+ this.list_dm = new instance.web.DropMisordered();
+ this.render_value_dm = new instance.web.DropMisordered();
},
- start: function() {
- this.$el.addClass('oe_form_field oe_form_field_many2many');
-
+ initialize_content: function() {
var self = this;
- self.load_view();
- this.is_loaded.done(function() {
- self.on("change:effective_readonly", self, function() {
- self.is_loaded = self.is_loaded.then(function() {
- self.list_view.destroy();
- return $.when(self.load_view()).done(function() {
- self.render_value();
- });
- });
+ this.$el.addClass('oe_form_field oe_form_field_many2many');
+
+ this.list_view = new instance.web.form.Many2ManyListView(this, this.dataset, false, {
+ 'addable': this.get("effective_readonly") ? null : _t("Add"),
+ 'deletable': this.get("effective_readonly") ? false : true,
+ 'selectable': this.multi_selection,
+ 'sortable': false,
+ 'reorderable': false,
+ 'import_enabled': false,
});
+ var embedded = (this.field.views || {}).tree;
+ if (embedded) {
+ this.list_view.set_embedded_view(embedded);
+ }
+ this.list_view.m2m_field = this;
+ var loaded = $.Deferred();
+ this.list_view.on("list_view_loaded", this, function() {
+ loaded.resolve();
});
- this._super.apply(this, arguments);
+ this.list_view.appendTo(this.$el);
+
+ var old_def = self.is_loaded;
+ self.is_loaded = $.Deferred().done(function() {
+ old_def.resolve();
+ });
+ this.list_dm.add(loaded).then(function() {
+ self.is_loaded.resolve();
+ });
+ },
+ destroy_content: function() {
+ this.list_view.destroy();
+ this.list_view = undefined;
},
set_value: function(value_) {
value_ = value_ || [];
@@ -4115,35 +4134,10 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
is_false: function () {
return _(this.get("value")).isEmpty();
},
- load_view: function() {
- var self = this;
- this.list_view = new instance.web.form.Many2ManyListView(this, this.dataset, false, {
- 'addable': self.get("effective_readonly") ? null : _t("Add"),
- 'deletable': self.get("effective_readonly") ? false : true,
- 'selectable': self.multi_selection,
- 'sortable': false,
- 'reorderable': false,
- 'import_enabled': false,
- });
- var embedded = (this.field.views || {}).tree;
- if (embedded) {
- this.list_view.set_embedded_view(embedded);
- }
- this.list_view.m2m_field = this;
- var loaded = $.Deferred();
- this.list_view.on("list_view_loaded", self, function() {
- self.initial_is_loaded.resolve();
- loaded.resolve();
- });
- $.async_when().done(function () {
- self.list_view.appendTo(self.$el);
- });
- return loaded;
- },
render_value: function() {
var self = this;
this.dataset.set_ids(this.get("value"));
- this.is_loaded = this.is_loaded.then(function() {
+ this.render_value_dm.add(this.is_loaded).then(function() {
return self.list_view.reload_content();
});
},
From c72fc633fcfc00818bb0ab5ada89e72acce4b6c5 Mon Sep 17 00:00:00 2001
From: "dle@openerp.com" <>
Date: Thu, 29 Nov 2012 14:43:18 +0100
Subject: [PATCH 57/77] [FIX]Wrong inherit commented
bzr revid: dle@openerp.com-20121129134318-c770ejnoop2b3z0j
---
addons/account_followup/account_followup_view.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml
index 61621189fe4..0617a95c2f0 100644
--- a/addons/account_followup/account_followup_view.xml
+++ b/addons/account_followup/account_followup_view.xml
@@ -115,7 +115,7 @@
-
+
-
+
From b75fde3773a2c84d31166560b045d93511ef8d8b Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 14:48:42 +0100
Subject: [PATCH 58/77] [FIX] account, sale_crm: fixed invoices analysis
bzr revid: qdp-launchpad@openerp.com-20121129134842-cro77z9siesjifdm
---
.../account/report/account_invoice_report.py | 47 ++++++++++++-------
.../sales_crm_account_invoice_report.py | 5 +-
2 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 48f9022a8dc..a001b6b4f52 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -101,7 +101,6 @@ class account_invoice_report(osv.osv):
}
_order = 'date desc'
-
def _select(self):
select_str = """
SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id,
@@ -109,8 +108,12 @@ class account_invoice_report(osv.osv):
sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state,
sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id,
sub.product_qty, sub.price_total / cr.rate as price_total, sub.price_average /cr.rate as price_average,
- cr.rate as currency_rate, sub.residual / cr.rate as residual, sub.section_id
- FROM (
+ cr.rate as currency_rate, sub.residual / cr.rate as residual
+ """
+ return select_str
+
+ def _sub_select(self):
+ select_str = """
SELECT min(ail.id) AS id,
ai.date_invoice AS date,
to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text) AS year,
@@ -167,13 +170,22 @@ class account_invoice_report(osv.osv):
LEFT JOIN account_invoice a ON a.id = l.invoice_id
WHERE a.id = ai.id)
ELSE 1::bigint
- END::numeric AS residual,
- ai.section_id
+ END::numeric AS residual
+ """
+ return select_str
+
+ def _from(self):
+ from_str = """
FROM account_invoice_line ail
JOIN account_invoice ai ON ai.id = ail.invoice_id
LEFT JOIN product_product pr ON pr.id = ail.product_id
left JOIN product_template pt ON pt.id = pr.product_tmpl_id
LEFT JOIN product_uom u ON u.id = ail.uos_id
+ """
+ return from_str
+
+ def _group_by(self):
+ group_by_str = """
GROUP BY ail.product_id, ai.date_invoice, ai.id,
to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text),
to_char(ai.date_invoice::timestamp with time zone, 'MM'::text),
@@ -181,7 +193,17 @@ class account_invoice_report(osv.osv):
ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,
ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id,
ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual,
- ai.amount_total, u.uom_type, u.category_id, ai.section_id
+ ai.amount_total, u.uom_type, u.category_id
+ """
+ return group_by_str
+
+ def init(self, cr):
+ # self._table = account_invoice_report
+ tools.drop_view_if_exists(cr, self._table)
+ cr.execute("""CREATE or REPLACE VIEW %s as (
+ %s
+ FROM (
+ %s %s %s
) AS sub
JOIN res_currency_rate cr ON (cr.currency_id = sub.currency_id)
WHERE
@@ -190,17 +212,10 @@ class account_invoice_report(osv.osv):
WHERE (cr2.currency_id = sub.currency_id)
AND ((sub.date IS NOT NULL AND cr.name <= sub.date)
OR (sub.date IS NULL AND cr.name <= NOW()))
- ORDER BY name DESC LIMIT 1);
- """
- return select_str
-
-
- def init(self, cr):
- # self._table = account_invoice_report
- tools.drop_view_if_exists(cr, self._table)
- cr.execute("CREATE or REPLACE VIEW %s as (%s)" % (
+ ORDER BY name DESC LIMIT 1)
+ )""" % (
self._table,
- self._select()))
+ self._select(), self._sub_select(), self._from(), self._group_by()))
account_invoice_report()
diff --git a/addons/sale_crm/report/sales_crm_account_invoice_report.py b/addons/sale_crm/report/sales_crm_account_invoice_report.py
index 8e356527536..27da7640946 100644
--- a/addons/sale_crm/report/sales_crm_account_invoice_report.py
+++ b/addons/sale_crm/report/sales_crm_account_invoice_report.py
@@ -27,7 +27,10 @@ class account_invoice_report(osv.osv):
}
def _select(self):
- return super(account_invoice_report, self)._select() + ", ai.section_id as section_id"
+ return super(account_invoice_report, self)._select() + ", sub.section_id as section_id"
+
+ def _sub_select(self):
+ return super(account_invoice_report, self)._sub_select() + ", ai.section_id as section_id"
def _group_by(self):
return super(account_invoice_report, self)._group_by() + ", ai.section_id"
From 001c45160831ea3bb7e735bad82d2d4043cc7b8b Mon Sep 17 00:00:00 2001
From: Vo Minh Thu
Date: Thu, 29 Nov 2012 15:07:45 +0100
Subject: [PATCH 59/77] [REV] reverted install-all commit
(vmt@openerp.com-20121128142106-pdkcruhyz0sjltk8)
bzr revid: vmt@openerp.com-20121129140745-wn2o9ek3beuf7y3y
---
openerp/cli/server.py | 10 ++----
openerp/modules/graph.py | 24 +++++++++------
openerp/modules/loading.py | 63 +++++++++++++++++++-------------------
3 files changed, 48 insertions(+), 49 deletions(-)
diff --git a/openerp/cli/server.py b/openerp/cli/server.py
index 9352ad37ef0..f030f801967 100644
--- a/openerp/cli/server.py
+++ b/openerp/cli/server.py
@@ -94,11 +94,7 @@ def setup_pid_file():
def preload_registry(dbname):
""" Preload a registry, and start the cron."""
try:
- config = openerp.tools.config
- update_module = True if config['init'] or config['update'] else False
- db, registry = openerp.pooler.get_db_and_pool(
- dbname, update_module=update_module, pooljobs=False,
- force_demo=not config['without_demo'])
+ db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=openerp.tools.config['init'] or openerp.tools.config['update'], pooljobs=False)
# jobs will start to be processed later, when openerp.cron.start_master_thread() is called by openerp.service.start_services()
registry.schedule_cron_jobs()
@@ -109,9 +105,7 @@ def run_test_file(dbname, test_file):
""" Preload a registry, possibly run a test file, and start the cron."""
try:
config = openerp.tools.config
- update_module = True if config['init'] or config['update'] else False
- db, registry = openerp.pooler.get_db_and_pool(
- dbname, update_module=update_module, pooljobs=False, force_demo=not config['without_demo'])
+ db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
cr = db.cursor()
_logger.info('loading test file %s', test_file)
openerp.tools.convert_yaml_import(cr, 'base', file(test_file), 'test', {}, 'test', True)
diff --git a/openerp/modules/graph.py b/openerp/modules/graph.py
index f7e9bc7c77a..56b17e3239a 100644
--- a/openerp/modules/graph.py
+++ b/openerp/modules/graph.py
@@ -87,19 +87,15 @@ class Graph(dict):
for k, v in additional_data[package.name].items():
setattr(package, k, v)
- def add_module(self, cr, module, force_demo=False):
- self.add_modules(cr, [module], force_demo)
+ def add_module(self, cr, module, force=None):
+ self.add_modules(cr, [module], force)
- def add_modules(self, cr, module_list, force_demo=False):
+ def add_modules(self, cr, module_list, force=None):
+ if force is None:
+ force = []
packages = []
len_graph = len(self)
for module in module_list:
- if force_demo:
- cr.execute("""
- UPDATE ir_module_module
- SET demo='t'
- WHERE name = %s""",
- (module,))
# This will raise an exception if no/unreadable descriptor file.
# NOTE The call to load_information_from_description_file is already
# done by db.initialize, so it is possible to not do it again here.
@@ -125,6 +121,9 @@ class Graph(dict):
current.remove(package)
node = self.add_node(package, info)
node.data = info
+ for kind in ('init', 'demo', 'update'):
+ if package in tools.config[kind] or 'all' in tools.config[kind] or kind in force:
+ setattr(node, kind, True)
else:
later.add(package)
packages.append((package, info))
@@ -186,11 +185,18 @@ class Node(Singleton):
node.depth = self.depth + 1
if node not in self.children:
self.children.append(node)
+ for attr in ('init', 'update', 'demo'):
+ if hasattr(self, attr):
+ setattr(node, attr, True)
self.children.sort(lambda x, y: cmp(x.name, y.name))
return node
def __setattr__(self, name, value):
super(Singleton, self).__setattr__(name, value)
+ if name in ('init', 'update', 'demo'):
+ tools.config[name][self.name] = 1
+ for child in self.children:
+ setattr(child, name, value)
if name == 'depth':
for child in self.children:
setattr(child, name, value + 1)
diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py
index 13b02bd7a6e..bcda1690c91 100644
--- a/openerp/modules/loading.py
+++ b/openerp/modules/loading.py
@@ -42,7 +42,6 @@ from openerp import SUPERUSER_ID
from openerp import SUPERUSER_ID
from openerp.tools.translate import _
-from openerp.tools import assertion_report
from openerp.modules.module import initialize_sys_path, \
load_openerp_module, init_module_models
@@ -158,7 +157,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
models = pool.load(cr, package)
loaded_modules.append(package.name)
- if package.state in ('to install', 'to upgrade'):
+ if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'):
init_module_models(cr, package.name, models)
pool._init_modules.add(package.name)
status['progress'] = float(index) / len(graph)
@@ -172,19 +171,18 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
idref = {}
- if package.state == 'to install':
+ mode = 'update'
+ if hasattr(package, 'init') or package.state == 'to install':
mode = 'init'
- else:
- mode = 'update'
- if package.state in ('to install', 'to upgrade'):
+ if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'):
if package.state=='to upgrade':
# upgrading the module information
modobj.write(cr, SUPERUSER_ID, [module_id], modobj.get_values_from_terp(package.data))
load_init_xml(module_name, idref, mode)
load_update_xml(module_name, idref, mode)
load_data(module_name, idref, mode)
- if package.dbdemo and package.state != 'installed':
+ if hasattr(package, 'demo') or (package.dbdemo and package.state != 'installed'):
status['progress'] = (index + 0.75) / len(graph)
load_demo_xml(module_name, idref, mode)
load_demo(module_name, idref, mode)
@@ -214,6 +212,9 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
modobj.update_translations(cr, SUPERUSER_ID, [module_id], None)
package.state = 'installed'
+ for kind in ('init', 'demo', 'update'):
+ if hasattr(package, kind):
+ delattr(package, kind)
cr.commit()
@@ -268,7 +269,10 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
if not openerp.modules.db.is_initialized(cr):
_logger.info("init db")
openerp.modules.db.initialize(cr)
- update_module = True
+ tools.config["init"]["all"] = 1
+ tools.config['update']['all'] = 1
+ if not tools.config['without_demo']:
+ tools.config["demo"]['all'] = 1
# This is a brand new pool, just created in pooler.get_db_and_pool()
pool = pooler.get_pool(cr.dbname)
@@ -278,51 +282,43 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
# STEP 1: LOAD BASE (must be done before module dependencies can be computed for later steps)
graph = openerp.modules.graph.Graph()
- graph.add_module(cr, 'base', force_demo)
+ graph.add_module(cr, 'base', force)
if not graph:
_logger.critical('module base cannot be loaded! (hint: verify addons-path)')
raise osv.osv.except_osv(_('Could not load base module'), _('module base cannot be loaded! (hint: verify addons-path)'))
# processed_modules: for cleanup step after install
# loaded_modules: to avoid double loading
- # After load_module_graph(), 'base' has been installed or updated and its state is 'installed'.
- report = assertion_report.assertion_report()
- loaded_modules, processed_modules = load_module_graph(cr, graph, status, report=report)
+ report = pool._assertion_report
+ loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
if tools.config['load_language']:
for lang in tools.config['load_language'].split(','):
tools.load_language(cr, lang)
# STEP 2: Mark other modules to be loaded/updated
- # This is a one-shot use of tools.config[init|update] from the command line
- # arguments. It is directly cleared to not interfer with later create/update
- # issued via RPC.
if update_module:
modobj = pool.get('ir.module.module')
- if ('base' in tools.config['init']) or ('base' in tools.config['update']) \
- or ('all' in tools.config['init']) or ('all' in tools.config['update']):
+ if ('base' in tools.config['init']) or ('base' in tools.config['update']):
_logger.info('updating modules list')
modobj.update_list(cr, SUPERUSER_ID)
- if 'all' in tools.config['init']:
- ids = modobj.search(cr, 1, [])
- tools.config['init'] = dict.fromkeys([m['name'] for m in modobj.read(cr, 1, ids, ['name'])], 1)
-
_check_module_names(cr, itertools.chain(tools.config['init'].keys(), tools.config['update'].keys()))
- mods = [k for k in tools.config['init'] if tools.config['init'][k] and k not in ('base', 'all')]
- ids = modobj.search(cr, SUPERUSER_ID, ['&', ('state', '=', 'uninstalled'), ('name', 'in', mods)])
- if ids:
- modobj.button_install(cr, SUPERUSER_ID, ids) # goes from 'uninstalled' to 'to install'
+ mods = [k for k in tools.config['init'] if tools.config['init'][k]]
+ if mods:
+ ids = modobj.search(cr, SUPERUSER_ID, ['&', ('state', '=', 'uninstalled'), ('name', 'in', mods)])
+ if ids:
+ modobj.button_install(cr, SUPERUSER_ID, ids)
- mods = [k for k in tools.config['update'] if tools.config['update'][k] and k not in ('base', 'all')]
- ids = modobj.search(cr, SUPERUSER_ID, ['&', ('state', '=', 'installed'), ('name', 'in', mods)])
- if ids:
- modobj.button_upgrade(cr, SUPERUSER_ID, ids) # goes from 'installed' to 'to upgrade'
+ mods = [k for k in tools.config['update'] if tools.config['update'][k]]
+ if mods:
+ ids = modobj.search(cr, SUPERUSER_ID, ['&', ('state', '=', 'installed'), ('name', 'in', mods)])
+ if ids:
+ modobj.button_upgrade(cr, SUPERUSER_ID, ids)
+
+ cr.execute("update ir_module_module set state=%s where name=%s", ('installed', 'base'))
- # Remove that funky global one-shot thingy.
- for kind in ('init', 'demo', 'update'):
- tools.config[kind] = {}
# STEP 3: Load marked modules (skipping base which was done in STEP 1)
# IMPORTANT: this is done in two parts, first loading all installed or
@@ -374,6 +370,9 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
# Cleanup orphan records
pool.get('ir.model.data')._process_end(cr, SUPERUSER_ID, processed_modules)
+ for kind in ('init', 'demo', 'update'):
+ tools.config[kind] = {}
+
cr.commit()
# STEP 5: Cleanup menus
From c166c19ed18a2737d7a885641ebb7b0d25f2b0ed Mon Sep 17 00:00:00 2001
From: Xavier Morel
Date: Thu, 29 Nov 2012 15:17:59 +0100
Subject: [PATCH 60/77] [REM] dead code from evaluation being client-side only
bzr revid: xmo@openerp.com-20121129141759-wj4je85nkrfznql1
---
addons/web/session.py | 30 ------------------------------
1 file changed, 30 deletions(-)
diff --git a/addons/web/session.py b/addons/web/session.py
index 523aaa9f1fa..65e3beab84a 100644
--- a/addons/web/session.py
+++ b/addons/web/session.py
@@ -188,34 +188,4 @@ class OpenERPSession(object):
context['lang'] = lang
- @property
- def base_eval_context(self):
- """ Default evaluation context for the session.
-
- Used to evaluate contexts and domains.
- """
- base = dict(
- uid=self._uid,
- current_date=datetime.date.today().strftime('%Y-%m-%d'),
- time=time,
- datetime=datetime,
- relativedelta=dateutil.relativedelta.relativedelta
- )
- base.update(self.context)
- return base
-
- def evaluation_context(self, context=None):
- """ Returns the session's evaluation context, augmented with the
- provided context if any.
-
- :param dict context: to add merge in the session's base eval context
- :returns: the augmented context
- :rtype: dict
- """
- d = dict(self.base_eval_context)
- if context:
- d.update(context)
- d['context'] = d
- return d
-
# vim:et:ts=4:sw=4:
From 40042cec1b3878809969dd51aa2abe498d701830 Mon Sep 17 00:00:00 2001
From: "dle@openerp.com" <>
Date: Thu, 29 Nov 2012 15:18:54 +0100
Subject: [PATCH 61/77] [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 }">
+
@@ -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)]
+
From 574f096fcebdb7329dce0d9c59fcfa5e063a4ef2 Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 15:24:28 +0100
Subject: [PATCH 62/77] [IMP] analytic: When creating new contract, select the
Template and dates Start and are now adapted accordingly to current time
bzr revid: qdp-launchpad@openerp.com-20121129142428-zpdy567efax0s5qb
---
addons/analytic/analytic.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py
index 708f9b3b196..6489d8aa760 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/analytic.py
@@ -20,8 +20,10 @@
##############################################################################
import time
+from datetime import datetime
from osv import fields, osv
+import tools
from tools.translate import _
import decimal_precision as dp
@@ -199,8 +201,11 @@ class account_analytic_account(osv.osv):
return {}
res = {'value':{}}
template = self.browse(cr, uid, template_id, context=context)
- res['value']['date_start'] = template.date_start
- res['value']['date'] = template.date
+ from_dt = datetime.strptime(template.date_start, tools.DEFAULT_SERVER_DATE_FORMAT)
+ to_dt = datetime.strptime(template.date, tools.DEFAULT_SERVER_DATE_FORMAT)
+ timedelta = to_dt - from_dt
+ res['value']['date_start'] = fields.date.today()
+ res['value']['date'] = datetime.strftime(datetime.now() + timedelta, tools.DEFAULT_SERVER_DATE_FORMAT)
res['value']['quantity_max'] = template.quantity_max
res['value']['description'] = template.description
return res
From 81035fea58e6faae45faf763bd01846580903c8b Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 15:27:12 +0100
Subject: [PATCH 63/77] [IMP] analytic: Add the parent field on the template
form
bzr revid: qdp-launchpad@openerp.com-20121129142712-yoluy6mxeh7a6ax1
---
addons/analytic/analytic_view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml
index 1277d25de71..938078b79e0 100644
--- a/addons/analytic/analytic_view.xml
+++ b/addons/analytic/analytic_view.xml
@@ -28,7 +28,7 @@
-
+
From 5b71f38603fb198bce32b810ecde04276744ae6b Mon Sep 17 00:00:00 2001
From: Fabien Pinckaers
Date: Thu, 29 Nov 2012 15:52:19 +0100
Subject: [PATCH 64/77] [FIX]
bzr revid: fp@tinyerp.com-20121129145219-q6wqvzy61mki2j26
---
addons/project/project_demo.xml | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml
index d2bf7d0a2df..f5fbf878fd0 100644
--- a/addons/project/project_demo.xml
+++ b/addons/project/project_demo.xml
@@ -40,7 +40,7 @@
-
+
@@ -53,7 +53,7 @@
-
+
@@ -63,13 +63,11 @@
project.task
public
-
+
-
+
@@ -78,13 +76,11 @@
Website Design Templates
project.task
-
+
-
+
@@ -99,7 +95,7 @@
-
+
From bd458541c128aea1e7deaa984cd3cb1166c5dee0 Mon Sep 17 00:00:00 2001
From: "dle@openerp.com" <>
Date: Thu, 29 Nov 2012 15:56:57 +0100
Subject: [PATCH 65/77] [FIX]Deleted ir.values makes test fail
bzr revid: dle@openerp.com-20121129145657-g8dgyay16mcije1r
---
addons/account/account_view.xml | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 6f099e4b824..b041d9fe409 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -263,13 +263,6 @@
-
-
+
From 64c486e59f1b093bfbf1461b7462b7fccafdcd05 Mon Sep 17 00:00:00 2001
From: Christophe Simonis
Date: Thu, 29 Nov 2012 16:20:38 +0100
Subject: [PATCH 66/77] [FIX] setup.py: include docutils on windows
bzr revid: chs@openerp.com-20121129152038-hx3km5x55x0oj9r1
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 6efec4e6125..4f1435c0603 100755
--- a/setup.py
+++ b/setup.py
@@ -64,7 +64,7 @@ def py2exe_options():
"skip_archive": 1,
"optimize": 2,
"dist_dir": 'dist',
- "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
+ "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "docutils", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
"excludes" : ["Tkconstants","Tkinter","tcl"],
}
}
From a520d65e87ed30c13f1cac48548e5abea20b678b Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 16:22:33 +0100
Subject: [PATCH 67/77] [IMP] account: in account.move.line search view, allow
to search on code of accounts as well as on the name column
bzr revid: qdp-launchpad@openerp.com-20121129152233-y5sqdyyygq76fcbi
---
addons/account/account_view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 7732d8d8cb0..53983551f72 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1238,7 +1238,7 @@
-
+
From cd9e7a32652aeecaac15f199f25a22e21b505ca1 Mon Sep 17 00:00:00 2001
From: "dle@openerp.com" <>
Date: Thu, 29 Nov 2012 16:24:44 +0100
Subject: [PATCH 68/77] [FIX]Hide useless columns in bank statement
bzr revid: dle@openerp.com-20121129152444-vislwoifnro7khcw
---
.../account_bank_statement_view.xml | 6 +++---
addons/account_voucher/account_voucher_view.xml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/account_bank_statement_extensions/account_bank_statement_view.xml b/addons/account_bank_statement_extensions/account_bank_statement_view.xml
index adc2963c803..d64eb68bc99 100644
--- a/addons/account_bank_statement_extensions/account_bank_statement_view.xml
+++ b/addons/account_bank_statement_extensions/account_bank_statement_view.xml
@@ -43,10 +43,10 @@
-
-
+
+
-
+
diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml
index 4dc753deedc..1e1481c3f2b 100644
--- a/addons/account_voucher/account_voucher_view.xml
+++ b/addons/account_voucher/account_voucher_view.xml
@@ -213,7 +213,7 @@
-
+
From cc6f0aa20a558e24886d48d5746a95994893295a Mon Sep 17 00:00:00 2001
From: niv-openerp
Date: Thu, 29 Nov 2012 16:36:01 +0100
Subject: [PATCH 69/77] [FIX] potential problem with pyeval datetime/date
today()/now() methods. Now only returns the same timezone than server (UTC).
bzr revid: nicolas.vanhoren@openerp.com-20121129153601-vtpnvkc0vylo9hux
---
addons/web/static/src/js/pyeval.js | 10 +++++-----
addons/web/static/test/evals.js | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/addons/web/static/src/js/pyeval.js b/addons/web/static/src/js/pyeval.js
index 265449f9f64..68a7453c958 100644
--- a/addons/web/static/src/js/pyeval.js
+++ b/addons/web/static/src/js/pyeval.js
@@ -398,14 +398,14 @@ openerp.web.pyeval = function (instance) {
now: py.classmethod.fromJSON(function () {
var d = new Date();
return py.PY_call(datetime.datetime,
- [d.getFullYear(), d.getMonth() + 1, d.getDate(),
- d.getHours(), d.getMinutes(), d.getSeconds(),
- d.getMilliseconds() * 1000]);
+ [d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),
+ d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),
+ d.getUTCMilliseconds() * 1000]);
}),
today: py.classmethod.fromJSON(function () {
var d = new Date();
return py.PY_call(datetime.datetime,
- [d.getFullYear(), d.getMonth() + 1, d.getDate()]);
+ [d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate()]);
}),
combine: py.classmethod.fromJSON(function () {
var args = py.PY_parseArgs(arguments, 'date time');
@@ -442,7 +442,7 @@ openerp.web.pyeval = function (instance) {
today: py.classmethod.fromJSON(function () {
var d = new Date();
return py.PY_call(
- datetime.date, [d.getFullYear(), d.getMonth() + 1, d.getDate()]);
+ datetime.date, [d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate()]);
}),
__eq__: function (other) {
return (this.year === other.year
diff --git a/addons/web/static/test/evals.js b/addons/web/static/test/evals.js
index 8e836dade7e..ac6e1f8b0f8 100644
--- a/addons/web/static/test/evals.js
+++ b/addons/web/static/test/evals.js
@@ -16,8 +16,8 @@ openerp.testing.section('eval.types', {
strictEqual(
py.eval("time.strftime('%Y-%m-%d %H:%M:%S')", context),
_.str.sprintf('%04d-%02d-%02d %02d:%02d:%02d',
- d.getFullYear(), d.getMonth() + 1, d.getDate(),
- d.getHours(), d.getMinutes(), d.getSeconds()));
+ d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),
+ d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()));
});
// Port from pypy/lib_pypy/test_datetime.py
var makeEq = function (instance, c2) {
From f9b9e7c4cb040d6dce43e8ba3616a1453a1d0db9 Mon Sep 17 00:00:00 2001
From: niv-openerp
Date: Thu, 29 Nov 2012 17:07:46 +0100
Subject: [PATCH 70/77] [IMP] added context_today()
bzr revid: nicolas.vanhoren@openerp.com-20121129160746-c3c691zk5fxhzse0
---
addons/web/static/src/js/pyeval.js | 17 ++++++++++++-----
addons/web/static/test/evals.js | 7 +++++++
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/addons/web/static/src/js/pyeval.js b/addons/web/static/src/js/pyeval.js
index 68a7453c958..4ee9fea0584 100644
--- a/addons/web/static/src/js/pyeval.js
+++ b/addons/web/static/src/js/pyeval.js
@@ -402,11 +402,6 @@ openerp.web.pyeval = function (instance) {
d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),
d.getUTCMilliseconds() * 1000]);
}),
- today: py.classmethod.fromJSON(function () {
- var d = new Date();
- return py.PY_call(datetime.datetime,
- [d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate()]);
- }),
combine: py.classmethod.fromJSON(function () {
var args = py.PY_parseArgs(arguments, 'date time');
return py.PY_call(datetime.datetime, [
@@ -479,6 +474,17 @@ openerp.web.pyeval = function (instance) {
return py.PY_call(datetime.date, [year, month, day])
}
});
+ /**
+ Returns the current local date, which means the date on the client (which can be different
+ compared to the date of the server).
+
+ @return {datetime.date}
+ */
+ var context_today = function() {
+ var d = new Date();
+ return py.PY_call(
+ datetime.date, [d.getFullYear(), d.getMonth() + 1, d.getDate()]);
+ };
datetime.time = py.type('time', null, {
__init__: function () {
var zero = py.float.fromJSON(0);
@@ -691,6 +697,7 @@ openerp.web.pyeval = function (instance) {
return {
uid: py.float.fromJSON(instance.session.uid),
datetime: datetime,
+ context_today: context_today,
time: time,
relativedelta: relativedelta,
current_date: py.PY_call(
diff --git a/addons/web/static/test/evals.js b/addons/web/static/test/evals.js
index ac6e1f8b0f8..e2dab6e9a17 100644
--- a/addons/web/static/test/evals.js
+++ b/addons/web/static/test/evals.js
@@ -19,6 +19,13 @@ openerp.testing.section('eval.types', {
d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),
d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()));
});
+ test('context_today', function (instance) {
+ var d = new Date();
+ var context = instance.web.pyeval.context();
+ strictEqual(
+ py.eval("context_today().strftime('%Y-%m-%d')", context),
+ String(_.str.sprintf('%04d-%02d-%02d', d.getFullYear(), d.getMonth() + 1, d.getDate())));
+ });
// Port from pypy/lib_pypy/test_datetime.py
var makeEq = function (instance, c2) {
var ctx = instance.web.pyeval.context();
From dc298cd336596c719874f942dec8c6babd359444 Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 17:08:47 +0100
Subject: [PATCH 71/77] [IMP] account_analytic_analysis: added an option to set
the template field mandatory on contracts
bzr revid: qdp-launchpad@openerp.com-20121129160847-k4dr5hd4dh2y3gcw
---
addons/account_analytic_analysis/__init__.py | 1 +
.../account_analytic_analysis/__openerp__.py | 1 +
.../account_analytic_analysis_view.xml | 12 +++++++
.../account_analytic_analysis/res_config.py | 31 +++++++++++++++++++
.../res_config_view.xml | 21 +++++++++++++
.../account_analytic_analysis_security.xml | 9 +++++-
addons/sale/res_config_view.xml | 4 +--
7 files changed, 76 insertions(+), 3 deletions(-)
create mode 100644 addons/account_analytic_analysis/res_config.py
create mode 100644 addons/account_analytic_analysis/res_config_view.xml
diff --git a/addons/account_analytic_analysis/__init__.py b/addons/account_analytic_analysis/__init__.py
index 429aa011f31..9aae723c5cf 100644
--- a/addons/account_analytic_analysis/__init__.py
+++ b/addons/account_analytic_analysis/__init__.py
@@ -21,6 +21,7 @@
import account_analytic_analysis
import cron_account_analytic_account
+import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_analysis/__openerp__.py b/addons/account_analytic_analysis/__openerp__.py
index 7675ef9f38e..53ebf225de1 100644
--- a/addons/account_analytic_analysis/__openerp__.py
+++ b/addons/account_analytic_analysis/__openerp__.py
@@ -40,6 +40,7 @@ Adds menu to show relevant information to each manager.You can also view the rep
'account_analytic_analysis_view.xml',
'account_analytic_analysis_menu.xml',
'account_analytic_analysis_cron.xml',
+ 'res_config_view.xml',
],
'css': [
'static/src/css/analytic.css'
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index be2a504658f..d88ae44fb5e 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -147,6 +147,18 @@
+
+ account.analytic.account.form.template.required
+ account.analytic.account
+
+
+
+
+ True
+
+
+
+
Template of Contract
ir.actions.act_window
diff --git a/addons/account_analytic_analysis/res_config.py b/addons/account_analytic_analysis/res_config.py
new file mode 100644
index 00000000000..94fe769fdd4
--- /dev/null
+++ b/addons/account_analytic_analysis/res_config.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Business Applications
+# Copyright (C) 2004-2012 OpenERP S.A. ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class sale_configuration(osv.osv_memory):
+ _inherit = 'sale.config.settings'
+
+ _columns = {
+ 'group_template_required': fields.boolean("Mandatory use of templates.",
+ implied_group='account_analytic_analysis.group_template_required',
+ help="Allows you to set the template field as required when creating an analytic account or a contract."),
+ }
diff --git a/addons/account_analytic_analysis/res_config_view.xml b/addons/account_analytic_analysis/res_config_view.xml
new file mode 100644
index 00000000000..9c7881f2a9e
--- /dev/null
+++ b/addons/account_analytic_analysis/res_config_view.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ sale settings
+ sale.config.settings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account_analytic_analysis/security/account_analytic_analysis_security.xml b/addons/account_analytic_analysis/security/account_analytic_analysis_security.xml
index 8bcc7f2d7f0..948c390e039 100644
--- a/addons/account_analytic_analysis/security/account_analytic_analysis_security.xml
+++ b/addons/account_analytic_analysis/security/account_analytic_analysis_security.xml
@@ -6,5 +6,12 @@
+
+ Mandatory use of templates in contracts
+
+ the field template of the analytic accounts and contracts will be required.
+
+
+
-
\ No newline at end of file
+
diff --git a/addons/sale/res_config_view.xml b/addons/sale/res_config_view.xml
index daf396d302b..b150fb276b7 100644
--- a/addons/sale/res_config_view.xml
+++ b/addons/sale/res_config_view.xml
@@ -86,13 +86,13 @@
your customer.
-
+
-
+
From f56badd8252fa62726f68266567d17f5181aa73f Mon Sep 17 00:00:00 2001
From: Fabien Pinckaers
Date: Thu, 29 Nov 2012 17:14:58 +0100
Subject: [PATCH 72/77] [IMP] project_issue private note for phu
bzr revid: fp@tinyerp.com-20121129161458-232bfavt2f9lln41
---
addons/project_issue/project_issue.py | 2 +-
addons/project_issue/project_issue_view.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index fe5ce9f325b..55aa0fd557b 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -225,7 +225,7 @@ class project_issue(base_stage, osv.osv):
Define Responsible user and Email account for mail gateway.'),
'partner_id': fields.many2one('res.partner', 'Contact', select=1),
'company_id': fields.many2one('res.company', 'Company'),
- 'description': fields.text('Description'),
+ 'description': fields.text('Private Note'),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=_ISSUE_STATE, string="Status", readonly=True,
help='The status is set to \'Draft\', when a case is created.\
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index 9e25fbca6a6..b7cdfbb0372 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -130,7 +130,7 @@
-
+
From 720f9093bcfff0996764e655a5b48bfa51062682 Mon Sep 17 00:00:00 2001
From: Fabien Pinckaers
Date: Thu, 29 Nov 2012 17:25:31 +0100
Subject: [PATCH 73/77] [IMP] layout issue forms
bzr revid: fp@tinyerp.com-20121129162531-26hx9nwmq7f94kp4
---
addons/project_issue/project_issue_view.xml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index b7cdfbb0372..60cc6448a46 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -111,21 +111,21 @@
-
-
-
-
+
+
+
+
+
+
-
-
From 219edfa80db568f37913404985bf0f4b6b027d6d Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 17:25:58 +0100
Subject: [PATCH 74/77] [FIX] analytic: fixed onchange of template
bzr revid: qdp-launchpad@openerp.com-20121129162558-sotcsrchh8p772xs
---
.../account_analytic_analysis_view.xml | 2 +-
addons/analytic/analytic.py | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index d88ae44fb5e..2ece3a38652 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -154,7 +154,7 @@
- True
+ {'required': [('type','=','contract')], 'invisible': [('type','in',['view', 'normal','template'])]}
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py
index 6489d8aa760..542acb1e88c 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/analytic.py
@@ -201,12 +201,14 @@ class account_analytic_account(osv.osv):
return {}
res = {'value':{}}
template = self.browse(cr, uid, template_id, context=context)
- from_dt = datetime.strptime(template.date_start, tools.DEFAULT_SERVER_DATE_FORMAT)
- to_dt = datetime.strptime(template.date, tools.DEFAULT_SERVER_DATE_FORMAT)
- timedelta = to_dt - from_dt
+ if template.date_start and template.date:
+ from_dt = datetime.strptime(template.date_start, tools.DEFAULT_SERVER_DATE_FORMAT)
+ to_dt = datetime.strptime(template.date, tools.DEFAULT_SERVER_DATE_FORMAT)
+ timedelta = to_dt - from_dt
+ res['value']['date'] = datetime.strftime(datetime.now() + timedelta, tools.DEFAULT_SERVER_DATE_FORMAT)
res['value']['date_start'] = fields.date.today()
- res['value']['date'] = datetime.strftime(datetime.now() + timedelta, tools.DEFAULT_SERVER_DATE_FORMAT)
res['value']['quantity_max'] = template.quantity_max
+ res['value']['parent_id'] = template.parent_id and template.parent_id.id or False
res['value']['description'] = template.description
return res
From ab7d73f3e3026e1207b05bbc02d284dfd0a89ccb Mon Sep 17 00:00:00 2001
From: "Quentin (OpenERP)"
Date: Thu, 29 Nov 2012 17:33:13 +0100
Subject: [PATCH 75/77] [IMP] analytic: usability
bzr revid: qdp-launchpad@openerp.com-20121129163313-aan0if5wex8v5dsx
---
addons/analytic/analytic_view.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml
index 938078b79e0..0faca841a0f 100644
--- a/addons/analytic/analytic_view.xml
+++ b/addons/analytic/analytic_view.xml
@@ -26,10 +26,10 @@
-
-
+
+
From 8acb5e3d4a93fe61be2fb13a82d1f5165f0b27e6 Mon Sep 17 00:00:00 2001
From: "dle@openerp.com" <>
Date: Thu, 29 Nov 2012 17:44:42 +0100
Subject: [PATCH 76/77] [DEL]Journal items wizard
bzr revid: dle@openerp.com-20121129164442-i50abrcy2ejvavee
---
addons/account/account_view.xml | 4 +-
.../account/test/account_fiscalyear_close.yml | 45 +---
addons/account/wizard/__init__.py | 1 -
addons/account/wizard/account_move_journal.py | 194 ------------------
.../wizard/account_move_journal_view.xml | 16 --
5 files changed, 2 insertions(+), 258 deletions(-)
delete mode 100644 addons/account/wizard/account_move_journal.py
delete mode 100644 addons/account/wizard/account_move_journal_view.xml
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index b041d9fe409..1dbb2561bc1 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1095,20 +1095,18 @@
-
+
-
diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml
index 10c949118c9..1c3547ccefd 100644
--- a/addons/account/test/account_fiscalyear_close.yml
+++ b/addons/account/test/account_fiscalyear_close.yml
@@ -46,47 +46,4 @@
!python {model: account.fiscalyear.close}: |
self.data_save(cr, uid, [ref("account_fiscalyear_close_0")], {"lang": 'en_US',
"active_model": "ir.ui.menu", "active_ids": [ref("account.menu_wizard_fy_close")],
- "tz": False, "active_id": ref("account.menu_wizard_fy_close"), })
-
--
- I check the opening entries By using "Entries by Line wizard"
--
- !record {model: account.move.journal, id: account_move_journal_0}:
- {}
--
- I clicked on Open Journal Button to check the entries
-
--
- !python {model: account.move.journal}: |
- self.action_open_window(cr, uid, [ref("account_move_journal_0")], {"lang": 'en_US',
- "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")],
- "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"),
- })
-
-#-
-# In order to test Cancel Opening Entries I cancelled the opening entries created for "Fiscal Year 2011"
-#-
-# !record {model: account.open.closed.fiscalyear, id: account_open_closed_fiscalyear_1}:
-# fyear_id: account.data_fiscalyear
-#-
-# I clicked on Open button
-#-
-# !python {model: account.open.closed.fiscalyear}: |
-# self.remove_entries(cr, uid, [ref("account_open_closed_fiscalyear_1")], {"lang":
-# 'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_wizard_open_closed_fy")],
-# "tz": False, "active_id": ref("account.menu_wizard_open_closed_fy"), })
-#-
-# I check the opening entries By using "Entries by Line wizard"
-#-
-# !record {model: account.move.journal, id: account_move_journal_2}:
-# journal_id: account.sales_journal
-# period_id: account_period_jan11
-#
-#-
-# I checked the Opening entries are cancelled successfully
-#-
-# !python {model: account.move.journal}: |
-# self.action_open_window(cr, uid, [ref("account_move_journal_2")], {"lang": 'en_US',
-# "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")],
-# "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"),
-# })
+ "tz": False, "active_id": ref("account.menu_wizard_fy_close"), })
\ No newline at end of file
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index 87a053d558c..839e490ca66 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -31,7 +31,6 @@ import account_reconcile_partner_process
import account_reconcile
import account_unreconcile
import account_invoice_refund
-import account_move_journal
import account_journal_select
import account_move_bank_reconcile
import account_subscription_generate
diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py
deleted file mode 100644
index 246532d38d7..00000000000
--- a/addons/account/wizard/account_move_journal.py
+++ /dev/null
@@ -1,194 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from lxml import etree
-
-from osv import osv, fields
-from tools.translate import _
-import tools
-
-class account_move_journal(osv.osv_memory):
- _name = "account.move.journal"
- _description = "Move journal"
-
- _columns = {
- 'target_move': fields.selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries'),
- ], 'Target Moves', required=True),
- }
-
- _defaults = {
- 'target_move': 'all'
- }
- def _get_period(self, cr, uid, context=None):
- """
- Return default account period value
- """
- account_period_obj = self.pool.get('account.period')
- ids = account_period_obj.find(cr, uid, context=context)
- period_id = False
- if ids:
- period_id = ids[0]
- return period_id
-
- def _get_journal(self, cr, uid, context=None):
- """
- Return journal based on the journal type
- """
-
- journal_id = False
-
- journal_pool = self.pool.get('account.journal')
- if context.get('journal_type', False):
- jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))])
- if not jids:
- raise osv.except_osv(_('Configuration Error!'), _('Cannot find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration/Journals/Journals.') % context.get('journal_type'))
- journal_id = jids[0]
-
- return journal_id
-
- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- """
- Returns views and fields for current model where view will depend on {view_type}.
- @param cr: A database cursor
- @param user: ID of the user currently logged in
- @param view_id: list of fields, which required to read signatures
- @param view_type: defines a view type. it can be one of (form, tree, graph, calender, gantt, search, mdx)
- @param context: context arguments, like lang, time zone
- @param toolbar: contains a list of reports, wizards, and links related to current model
-
- @return: Returns a dict that contains definition for fields, views, and toolbars
- """
- if context is None:context = {}
- res = super(account_move_journal, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
-
- if context:
- if not view_id:
- return res
-
- period_pool = self.pool.get('account.period')
- journal_pool = self.pool.get('account.journal')
-
- journal_id = self._get_journal(cr, uid, context)
- period_id = self._get_period(cr, uid, context)
-
- journal = False
- if journal_id:
- journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).get('name',False)
- journal_string = _("Journal: %s") % tools.ustr(journal)
- else:
- journal_string = _("Journal: All")
-
- period = False
- if period_id:
- period = period_pool.browse(cr, uid, period_id, context=context).name
- period_string = _("Period: %s") % tools.ustr(period)
-
- open_string = _("Open")
- view = """
- """ % (_('Journal'), journal_string, _('Period'), period_string, open_string)
-
- view = etree.fromstring(view.encode('utf8'))
- xarch, xfields = self._view_look_dom_arch(cr, uid, view, view_id, context=context)
- view = xarch
- res.update({
- 'arch': view
- })
- return res
-
- def action_open_window(self, cr, uid, ids, context=None):
- """
- This function Open action move line window on given period and Journal/Payment Mode
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: account move journal’s ID or list of IDs
- @return: dictionary of Open action move line window on given period and Journal/Payment Mode
- """
-
- period_pool = self.pool.get('account.journal.period')
- data_pool = self.pool.get('ir.model.data')
- journal_pool = self.pool.get('account.journal')
- account_period_obj = self.pool.get('account.period')
-
- if context is None:
- context = {}
-
- journal_id = self._get_journal(cr, uid, context)
- period_id = self._get_period(cr, uid, context)
- target_move = self.read(cr, uid, ids, ['target_move'], context=context)[0]['target_move']
-
- name = _("Journal Items")
- if journal_id:
- ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)], context=context)
-
- if not ids:
- journal = journal_pool.browse(cr, uid, journal_id, context=context)
- period = account_period_obj.browse(cr, uid, period_id, context=context)
-
- name = journal.name
- state = period.state
-
- if state == 'done':
- raise osv.except_osv(_('User Error!'), _('This period is already closed.'))
-
- company = period.company_id.id
- res = {
- 'name': name,
- 'period_id': period_id,
- 'journal_id': journal_id,
- 'company_id': company
- }
- period_pool.create(cr, uid, res,context=context)
-
- ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)], context=context)
- period = period_pool.browse(cr, uid, ids[0], context=context)
- name = (period.journal_id.code or '') + ':' + (period.period_id.code or '')
-
- result = data_pool.get_object_reference(cr, uid, 'account', 'view_account_move_line_filter')
- res_id = result and result[1] or False
- move = 0
- if target_move == 'posted':
- move = 1
- return {
- 'name': name,
- 'view_type': 'form',
- 'view_mode': 'tree,graph,form',
- 'res_model': 'account.move.line',
- 'view_id': False,
- 'context': "{'search_default_posted': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (move, journal_id, period_id),
- 'type': 'ir.actions.act_window',
- 'search_view_id': res_id
- }
-
-account_move_journal()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_move_journal_view.xml b/addons/account/wizard/account_move_journal_view.xml
deleted file mode 100644
index 5d80cf319c5..00000000000
--- a/addons/account/wizard/account_move_journal_view.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
- account.move.journal.form
- account.move.journal
-
-
-
-
-
-
-
From cb968eeba0ea8bf740eaef19d724bb2607394dfd Mon Sep 17 00:00:00 2001
From: Christophe Simonis
Date: Thu, 29 Nov 2012 18:21:45 +0100
Subject: [PATCH 77/77] [FIX] ir.ui.menu: filter menus as SUPERUSER
bzr revid: chs@openerp.com-20121129172145-0ionmbffc72hwxoa
---
openerp/addons/base/ir/ir_ui_menu.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/openerp/addons/base/ir/ir_ui_menu.py b/openerp/addons/base/ir/ir_ui_menu.py
index 43ece8c0868..a8475d33552 100644
--- a/openerp/addons/base/ir/ir_ui_menu.py
+++ b/openerp/addons/base/ir/ir_ui_menu.py
@@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL ().
-# Copyright (C) 2010-2011 OpenERP SA ().
+# Copyright (C) 2010-2012 OpenERP SA ().
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -62,7 +62,7 @@ class ir_ui_menu(osv.osv):
modelaccess = self.pool.get('ir.model.access')
user_groups = set(self.pool.get('res.users').read(cr, SUPERUSER_ID, uid, ['groups_id'])['groups_id'])
result = []
- for menu in self.browse(cr, uid, ids, context=context):
+ for menu in self.browse(cr, SUPERUSER_ID, ids, context=context):
# this key works because user access rights are all based on user's groups (cfr ir_model_access.check)
key = (cr.dbname, menu.id, tuple(user_groups))
if key in self._cache: