diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index c170076cfc8..0131ca0437b 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -48,7 +48,6 @@ module named account_voucher. 'security/account_security.xml', 'security/ir.model.access.csv', 'account_menuitem.xml', - 'account_wizard.xml', 'report/account_invoice_report_view.xml', 'report/account_entries_report_view.xml', 'report/account_report_view.xml', diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 173f0651a90..93d2a6fb00d 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -149,6 +149,7 @@ class account_bank_statement(osv.osv): \n* And after getting confirmation from the bank it will be in \'Confirmed\' state.'), 'currency': fields.function(_currency, method=True, string='Currency', type='many2one', relation='res.currency'), + 'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'), } _defaults = { @@ -369,14 +370,15 @@ class account_bank_statement(osv.osv): done.append(st.id) return self.write(cr, uid, done, {'state':'draft'}, context=context) - def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None): - cursor.execute('SELECT balance_end_real \ + def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None): + cr.execute('SELECT balance_end_real \ FROM account_bank_statement \ WHERE journal_id = %s AND NOT state = %s \ ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft')) - res = cursor.fetchone() + res = cr.fetchone() balance_start = res and res[0] or 0.0 - return {'value': {'balance_start': balance_start}} + account_id = self.pool.get('account.journal').read(cr, uid, journal_id, ['default_debit_account_id'], context=context)['default_debit_account_id'] + return {'value': {'balance_start': balance_start, 'account_id': account_id}} def unlink(self, cr, uid, ids, context=None): stat = self.read(cr, uid, ids, ['state']) @@ -454,4 +456,4 @@ class account_bank_statement_line(osv.osv): account_bank_statement_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 9480f29decd..ad31f87d6ae 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -36,7 +36,7 @@ - + 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) OR id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date) + query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date) else: ids = ','.join([str(x) for x in context['periods']]) query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND id IN (%s)) %s %s" % (fiscalyear_clause, ids, where_move_state, where_move_lines_by_date) @@ -541,7 +541,9 @@ class account_move_line(osv.osv): ] #TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id - def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False): + def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False, context=None): + if context is None: + context = {} account_obj = self.pool.get('account.account') journal_obj = self.pool.get('account.journal') currency_obj = self.pool.get('res.currency') @@ -552,7 +554,8 @@ class account_move_line(osv.osv): if (amount>0) and journal: x = journal_obj.browse(cr, uid, journal).default_credit_account_id if x: acc = x - v = currency_obj.compute(cr, uid, currency_id, acc.company_id.currency_id.id, amount, account=acc) + context.update({'date': date}) + v = currency_obj.compute(cr, uid, currency_id, acc.company_id.currency_id.id, amount, account=acc, context=context) result['value'] = { 'debit': v > 0 and v or 0.0, 'credit': v < 0 and -v or 0.0 diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index a031aafd9e8..f2b4da6ea23 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -609,16 +609,29 @@ - + + - + + + + + + + + + + + + + @@ -1155,7 +1168,7 @@ diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml deleted file mode 100644 index 0e48dfc7b66..00000000000 --- a/addons/account/account_wizard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/addons/account/i18n/ar.po b/addons/account/i18n/ar.po index d3233f9272a..77aa5f000f0 100644 --- a/addons/account/i18n/ar.po +++ b/addons/account/i18n/ar.po @@ -406,6 +406,11 @@ msgstr "" msgid "Error! You can not create recursive analytic accounts." msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.bank.statement.reconcile,total_entry:0 msgid "Total entries" diff --git a/addons/account/i18n/bg.po b/addons/account/i18n/bg.po index 0a46ee887c5..232326c597d 100644 --- a/addons/account/i18n/bg.po +++ b/addons/account/i18n/bg.po @@ -26,6 +26,11 @@ msgstr "Вътрешно име" msgid "Account Tax Code" msgstr "Данъчен код" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree9 #: model:ir.ui.menu,name:account.menu_action_invoice_tree9 diff --git a/addons/account/i18n/bs.po b/addons/account/i18n/bs.po index c20e3d47322..2d7cdaab649 100644 --- a/addons/account/i18n/bs.po +++ b/addons/account/i18n/bs.po @@ -26,6 +26,11 @@ msgstr "Interni naziv" msgid "Account Tax Code" msgstr "Šifra poreza" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree9 #: model:ir.ui.menu,name:account.menu_action_invoice_tree9 diff --git a/addons/account/i18n/ca.po b/addons/account/i18n/ca.po index f10efb2397f..9976d545972 100644 --- a/addons/account/i18n/ca.po +++ b/addons/account/i18n/ca.po @@ -27,6 +27,11 @@ msgstr "Nom intern" msgid "Account Tax Code" msgstr "Codi impost comptable" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree9 #: model:ir.ui.menu,name:account.menu_action_invoice_tree9 diff --git a/addons/account/i18n/cs.po b/addons/account/i18n/cs.po index 3f878c3817c..53157da726f 100644 --- a/addons/account/i18n/cs.po +++ b/addons/account/i18n/cs.po @@ -28,6 +28,11 @@ msgstr "Interní jméno" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/es_AR.po b/addons/account/i18n/es_AR.po index c763da1d8da..959296807a9 100644 --- a/addons/account/i18n/es_AR.po +++ b/addons/account/i18n/es_AR.po @@ -28,6 +28,11 @@ msgstr "Nombre interno" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/et.po b/addons/account/i18n/et.po index 7358f33d3e9..325883783a6 100644 --- a/addons/account/i18n/et.po +++ b/addons/account/i18n/et.po @@ -21,6 +21,11 @@ msgstr "" msgid "Internal Name" msgstr "Sisemine nimi" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: view:account.tax.code:0 msgid "Account Tax Code" diff --git a/addons/account/i18n/eu.po b/addons/account/i18n/eu.po index 7a0910887f1..40c655607f9 100644 --- a/addons/account/i18n/eu.po +++ b/addons/account/i18n/eu.po @@ -29,6 +29,11 @@ msgstr "Barne Izena" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/fa.po b/addons/account/i18n/fa.po index c9da4d5dcdf..e97963f90e2 100644 --- a/addons/account/i18n/fa.po +++ b/addons/account/i18n/fa.po @@ -22,6 +22,11 @@ msgstr "" msgid "Internal Name" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,result_selection:0 #: field:account.aged.trial.balance,result_selection:0 diff --git a/addons/account/i18n/fi.po b/addons/account/i18n/fi.po index 26d666eb8eb..d9bd9c5f568 100644 --- a/addons/account/i18n/fi.po +++ b/addons/account/i18n/fi.po @@ -27,6 +27,11 @@ msgstr "Sisäinen nimi" msgid "Account Tax Code" msgstr "Tilin verokoodi" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree9 #: model:ir.ui.menu,name:account.menu_action_invoice_tree9 diff --git a/addons/account/i18n/gl.po b/addons/account/i18n/gl.po index 3aeb3b99785..97606a03978 100644 --- a/addons/account/i18n/gl.po +++ b/addons/account/i18n/gl.po @@ -25,6 +25,11 @@ msgstr "" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/gu.po b/addons/account/i18n/gu.po index 3578c4a999c..c259d2c9437 100644 --- a/addons/account/i18n/gu.po +++ b/addons/account/i18n/gu.po @@ -24,6 +24,11 @@ msgstr "" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/hr.po b/addons/account/i18n/hr.po index 35c2e0b4c49..9463c49a43e 100644 --- a/addons/account/i18n/hr.po +++ b/addons/account/i18n/hr.po @@ -21,6 +21,11 @@ msgstr "" msgid "Internal Name" msgstr "Interni naziv" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: view:account.tax.code:0 msgid "Account Tax Code" diff --git a/addons/account/i18n/hu.po b/addons/account/i18n/hu.po index 5414080872e..9b63f93b7ff 100644 --- a/addons/account/i18n/hu.po +++ b/addons/account/i18n/hu.po @@ -28,6 +28,11 @@ msgstr "" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/id.po b/addons/account/i18n/id.po index 6086832bf1e..d66c5e0748b 100644 --- a/addons/account/i18n/id.po +++ b/addons/account/i18n/id.po @@ -29,6 +29,11 @@ msgstr "Nama Internal" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/kab.po b/addons/account/i18n/kab.po index e70fa3d4c1b..4349ce72478 100644 --- a/addons/account/i18n/kab.po +++ b/addons/account/i18n/kab.po @@ -22,6 +22,11 @@ msgstr "" msgid "Internal Name" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,result_selection:0 #: field:account.aged.trial.balance,result_selection:0 diff --git a/addons/account/i18n/ko.po b/addons/account/i18n/ko.po index c3f94cd30e4..8aa97b7bc5a 100644 --- a/addons/account/i18n/ko.po +++ b/addons/account/i18n/ko.po @@ -22,6 +22,11 @@ msgstr "" msgid "Internal Name" msgstr "내부 명칭" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,result_selection:0 #: field:account.aged.trial.balance,result_selection:0 diff --git a/addons/account/i18n/lt.po b/addons/account/i18n/lt.po index a2787590945..b8635bc133a 100644 --- a/addons/account/i18n/lt.po +++ b/addons/account/i18n/lt.po @@ -21,6 +21,11 @@ msgstr "" msgid "Internal Name" msgstr "Vidinis vardas" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: view:account.tax.code:0 msgid "Account Tax Code" diff --git a/addons/account/i18n/lv.po b/addons/account/i18n/lv.po index 1e2c4a4fa3d..4fc10de7fe9 100644 --- a/addons/account/i18n/lv.po +++ b/addons/account/i18n/lv.po @@ -22,6 +22,11 @@ msgstr "" msgid "Internal Name" msgstr "Iekšējais Nosaukums" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,result_selection:0 #: field:account.aged.trial.balance,result_selection:0 diff --git a/addons/account/i18n/mn.po b/addons/account/i18n/mn.po index 28b72309afe..7cc3887959d 100644 --- a/addons/account/i18n/mn.po +++ b/addons/account/i18n/mn.po @@ -22,6 +22,11 @@ msgstr "" msgid "Internal Name" msgstr "Дотоод нэр" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: view:account.tax.code:0 msgid "Account Tax Code" diff --git a/addons/account/i18n/nb.po b/addons/account/i18n/nb.po index bf935ebbcb8..8fcaf672431 100644 --- a/addons/account/i18n/nb.po +++ b/addons/account/i18n/nb.po @@ -22,6 +22,11 @@ msgstr "" msgid "Internal Name" msgstr "Internt Navn" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: view:account.tax.code:0 msgid "Account Tax Code" diff --git a/addons/account/i18n/nl_BE.po b/addons/account/i18n/nl_BE.po index fb7ac3d362e..0b2f06435b0 100644 --- a/addons/account/i18n/nl_BE.po +++ b/addons/account/i18n/nl_BE.po @@ -26,6 +26,11 @@ msgstr "Interne naam" msgid "Account Tax Code" msgstr "Belasting code" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,result_selection:0 #: field:account.aged.trial.balance,result_selection:0 diff --git a/addons/account/i18n/oc.po b/addons/account/i18n/oc.po index 5bea3f0baaf..cb6e5c943ca 100644 --- a/addons/account/i18n/oc.po +++ b/addons/account/i18n/oc.po @@ -22,6 +22,11 @@ msgstr "" msgid "Internal Name" msgstr "Nom intèrne" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: view:account.tax.code:0 msgid "Account Tax Code" diff --git a/addons/account/i18n/si.po b/addons/account/i18n/si.po index 3724668ac57..090213d32ce 100644 --- a/addons/account/i18n/si.po +++ b/addons/account/i18n/si.po @@ -34,6 +34,11 @@ msgstr "" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/sk.po b/addons/account/i18n/sk.po index b55bdc77af5..4abd57c998b 100644 --- a/addons/account/i18n/sk.po +++ b/addons/account/i18n/sk.po @@ -3860,6 +3860,11 @@ msgstr "" msgid "Select Chart" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: selection:account.chart,init,target_move:0 #: model:ir.actions.report.xml,name:account.account_move_line_list diff --git a/addons/account/i18n/sl.po b/addons/account/i18n/sl.po index d2291ea07a0..f368c9a3e23 100644 --- a/addons/account/i18n/sl.po +++ b/addons/account/i18n/sl.po @@ -28,6 +28,11 @@ msgstr "Interni naziv" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.ui.menu,name:account.menu_account_pl_report msgid "Profit And Loss" diff --git a/addons/account/i18n/sq.po b/addons/account/i18n/sq.po index 1d91580af96..2f2aff4dc8c 100644 --- a/addons/account/i18n/sq.po +++ b/addons/account/i18n/sq.po @@ -29,6 +29,11 @@ msgstr "Emri i Brendshëm" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/sr.po b/addons/account/i18n/sr.po index 8be975a9d13..de2e78a4156 100644 --- a/addons/account/i18n/sr.po +++ b/addons/account/i18n/sr.po @@ -27,6 +27,11 @@ msgstr "Interno ime" msgid "Account Tax Code" msgstr "Poreska tarifa konta" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree9 #: model:ir.ui.menu,name:account.menu_action_invoice_tree9 diff --git a/addons/account/i18n/ta.po b/addons/account/i18n/ta.po index 3bcbb806af1..141f13322ae 100644 --- a/addons/account/i18n/ta.po +++ b/addons/account/i18n/ta.po @@ -29,6 +29,11 @@ msgstr "உட் பெயர்" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.ui.menu,name:account.menu_account_pl_report msgid "Profit And Loss" diff --git a/addons/account/i18n/te.po b/addons/account/i18n/te.po index 718011859cd..ed00b4b4e94 100644 --- a/addons/account/i18n/te.po +++ b/addons/account/i18n/te.po @@ -32,6 +32,11 @@ msgstr "" msgid "Profit And Loss" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.ui.menu,name:account.menu_account_bs_report msgid "Balance Sheet" diff --git a/addons/account/i18n/th.po b/addons/account/i18n/th.po index 35feb251b63..e5aef73956d 100644 --- a/addons/account/i18n/th.po +++ b/addons/account/i18n/th.po @@ -34,6 +34,11 @@ msgstr "รหัสบัญชีภาษี" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/tlh.po b/addons/account/i18n/tlh.po index 8691c6e0e10..c65e9ba80d4 100644 --- a/addons/account/i18n/tlh.po +++ b/addons/account/i18n/tlh.po @@ -33,6 +33,11 @@ msgstr "" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/ug.po b/addons/account/i18n/ug.po index c1a0ee44fdb..5eddb6d0be7 100644 --- a/addons/account/i18n/ug.po +++ b/addons/account/i18n/ug.po @@ -29,6 +29,11 @@ msgstr "ئىچكى ئىسمى" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/uk.po b/addons/account/i18n/uk.po index 001ce91b0f2..8fa3e7652ac 100644 --- a/addons/account/i18n/uk.po +++ b/addons/account/i18n/uk.po @@ -28,6 +28,11 @@ msgstr "Внутрішня назва" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po index 52973936def..a3c29ee8820 100644 --- a/addons/account/i18n/zh_CN.po +++ b/addons/account/i18n/zh_CN.po @@ -26,6 +26,11 @@ msgstr "内部名称" msgid "Account Tax Code" msgstr "税事务科目" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree9 #: model:ir.ui.menu,name:account.menu_action_invoice_tree9 diff --git a/addons/account/i18n/zh_HK.po b/addons/account/i18n/zh_HK.po index 6c864a26e64..8adaea2332d 100644 --- a/addons/account/i18n/zh_HK.po +++ b/addons/account/i18n/zh_HK.po @@ -27,6 +27,11 @@ msgstr "內部名稱" msgid "Account Tax Code" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree9 #: model:ir.ui.menu,name:account.menu_action_invoice_tree9 diff --git a/addons/account/i18n/zh_TW.po b/addons/account/i18n/zh_TW.po index 694d041e926..e6157c7e5e6 100644 --- a/addons/account/i18n/zh_TW.po +++ b/addons/account/i18n/zh_TW.po @@ -27,6 +27,11 @@ msgstr "內部名稱" msgid "Partner's" msgstr "" +#. module: account +#: model:ir.ui.menu,name:account.next_id_22 +msgid "Partners" +msgstr "" + #. module: account #: field:account.partner.balance,display_partner:0 msgid "Display Partners" diff --git a/addons/account_sequence/__init__.py b/addons/account_sequence/__init__.py index 535fb766048..b6707106d4b 100644 --- a/addons/account_sequence/__init__.py +++ b/addons/account_sequence/__init__.py @@ -20,5 +20,6 @@ ############################################################################## import account_sequence +import account_sequence_installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_sequence/__openerp__.py b/addons/account_sequence/__openerp__.py index 966cbcbc8ca..1e3f91a7876 100644 --- a/addons/account_sequence/__openerp__.py +++ b/addons/account_sequence/__openerp__.py @@ -30,7 +30,11 @@ 'website': 'http://www.openerp.com', 'depends': ['account'], 'init_xml': [], - 'update_xml': ['account_sequence_data.xml','account_sequence.xml'], + 'update_xml': [ + 'account_sequence_data.xml', + 'account_sequence_installer_view.xml', + 'account_sequence.xml' + ], 'demo_xml': [], 'installable': True, 'active': False, diff --git a/addons/account_sequence/account_sequence.py b/addons/account_sequence/account_sequence.py index 309bf3bc803..56accc5f6eb 100644 --- a/addons/account_sequence/account_sequence.py +++ b/addons/account_sequence/account_sequence.py @@ -33,11 +33,11 @@ class account_move(osv.osv): obj_sequence = self.pool.get('ir.sequence') res = super(account_move, self).post(cr, uid, ids, context=context) seq_no = False - for line in self.browse(cr, uid, ids): - if line.journal_id.internal_sequence: - seq_no = obj_sequence.get_id(cr, uid, line.journal_id.internal_sequence.id, context=context) + for move in self.browse(cr, uid, ids, context): + if move.journal_id.internal_sequence_id: + seq_no = obj_sequence.get_id(cr, uid, move.journal_id.internal_sequence_id.id, context=context) if seq_no: - self.write(cr, uid, [line.id], {'internal_sequence_number': seq_no}) + self.write(cr, uid, [move.id], {'internal_sequence_number': seq_no}) return res account_move() @@ -46,7 +46,7 @@ class account_journal(osv.osv): _inherit = "account.journal" _columns = { - 'internal_sequence': fields.many2one('ir.sequence', 'Internal Sequence'), + 'internal_sequence_id': fields.many2one('ir.sequence', 'Internal Sequence', help="This sequence will be used to maintain the internal number for the journal entries related to this journal."), } account_journal() @@ -57,5 +57,7 @@ class account_move_line(osv.osv): _columns = { 'internal_sequence_number': fields.related('move_id','internal_sequence_number', type='char', relation='account.move', help='Internal Sequence Number', string='Internal Number'), } + account_move_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_sequence/account_sequence.xml b/addons/account_sequence/account_sequence.xml index dd9c1a36cd4..6b9e2c94402 100644 --- a/addons/account_sequence/account_sequence.xml +++ b/addons/account_sequence/account_sequence.xml @@ -21,7 +21,7 @@ - + diff --git a/addons/account_sequence/account_sequence_data.xml b/addons/account_sequence/account_sequence_data.xml index 0059f7d41a9..1ad362b3979 100644 --- a/addons/account_sequence/account_sequence_data.xml +++ b/addons/account_sequence/account_sequence_data.xml @@ -1,14 +1,6 @@ - - - Internal Sequence Journal - account.journal - 1 - - - diff --git a/addons/account_sequence/account_sequence_installer.py b/addons/account_sequence/account_sequence_installer.py new file mode 100644 index 00000000000..f7bcb113388 --- /dev/null +++ b/addons/account_sequence/account_sequence_installer.py @@ -0,0 +1,83 @@ +# -*- 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 osv import fields, osv + +class account_sequence_installer(osv.osv_memory): + _name = 'account.sequence.installer' + _inherit = 'res.config.installer' + + _columns = { + 'name': fields.char('Name',size=64, required=True), + 'prefix': fields.char('Prefix',size=64, help="Prefix value of the record for the sequence"), + 'suffix': fields.char('Suffix',size=64, help="Suffix value of the record for the sequence"), + 'number_next': fields.integer('Next Number', required=True, help="Next number of this sequence"), + 'number_increment': fields.integer('Increment Number', required=True, help="The next number of the sequence will be incremented by this number"), + 'padding' : fields.integer('Number padding', required=True, help="OpenERP will automatically adds some '0' on the left of the 'Next Number' to get the required padding size."), + 'company_id': fields.many2one('res.company', 'Company'), + } + _defaults = { + 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'ir.sequence', context=c), + 'number_increment': 1, + 'number_next': 1, + 'padding' : 0, + 'name': 'Internal Sequence Journal', + } + + def execute(self, cr, uid, ids, context=None): + if context is None: + context = {} + jou_obj = self.pool.get('account.journal') + obj_sequence = self.pool.get('ir.sequence') + record = self.browse(cr, uid, ids, context)[0] + j_ids = [] + if record.company_id: + company_id = record.company_id.id, + search_criteria = [('company_id', '=', company_id)] + else: + company_id = False + search_criteria = [] + vals = { + 'id': 'internal_sequence_journal', + 'code': 'account.journal', + 'name': record.name, + 'prefix': record.prefix, + 'suffix': record.suffix, + 'number_next': record.number_next, + 'number_increment': record.number_increment, + 'padding' : record.padding, + 'company_id': company_id, + } + + ir_seq = obj_sequence.create(cr, uid, vals, context) + res = super(account_sequence_installer, self).execute(cr, uid, ids, context=context) + journal_ids = jou_obj.search(cr, uid, search_criteria, context=context) + for journal in jou_obj.browse(cr, uid, journal_ids, context): + if not journal.internal_sequence_id: + j_ids.append(journal.id) + if j_ids: + jou_obj.write(cr, uid, j_ids, {'internal_sequence_id': ir_seq}) + self.pool.get('ir.values').set(cr, uid, key='default', key2=False, name='internal_sequence_id', models =[('account.journal', False)], value=ir_seq) + return res + +account_sequence_installer() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_sequence/account_sequence_installer_view.xml b/addons/account_sequence/account_sequence_installer_view.xml new file mode 100644 index 00000000000..1051b133045 --- /dev/null +++ b/addons/account_sequence/account_sequence_installer_view.xml @@ -0,0 +1,57 @@ + + + + + + account.sequence.installer.view + account.sequence.installer + form + + + +
+ Account Sequence Application Configuration +
+ + Configure Your Account Sequence Application + + + + + + You can enhance the Account Sequence Application by installing . + + + + + + + + + + + + Configure + +
+
+
+ + + Account Sequence Application Configuration + ir.actions.act_window + account.sequence.installer + + form + form + new + + + + + 3 + onskip + + +
+
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 8bd7b64f3f4..03ac3b87ba0 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -140,6 +140,20 @@ class account_voucher(osv.osv): res['arch'] = etree.tostring(doc) return res + def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): + if not ids: return {} + res = {} + for voucher in self.browse(cr, uid, ids, context=context): + debit= credit = 0.0 + if voucher.line_dr_ids: + for line in voucher.line_dr_ids: + debit += line.amount_unreconciled + if voucher.line_cr_ids: + for line in voucher.line_cr_ids: + credit += line.amount_unreconciled + res[voucher.id] = abs(voucher.amount - abs(credit - debit)) + return res + _name = 'account.voucher' _description = 'Accounting Voucher' _order = "date desc, id desc" @@ -190,6 +204,15 @@ class account_voucher(osv.osv): 'tax_id':fields.many2one('account.tax', 'Tax', readonly=True, states={'draft':[('readonly',False)]}), 'pre_line':fields.boolean('Previous Payments ?', required=False), 'date_due': fields.date('Due Date', readonly=True, states={'draft':[('readonly',False)]}), + 'payment_option':fields.selection([ + ('without_writeoff', 'Without Write-off'), + ('with_writeoff', 'With Write-off'), + ], 'Payment Option', required=True, readonly=True, states={'draft': [('readonly', False)]}), + 'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', readonly=True, states={'draft': [('readonly', False)]}), + 'writeoff_journal_id': fields.many2one('account.journal', 'Write-Off journal', readonly=True, states={'draft': [('readonly', False)]}), + 'comment': fields.char('Comment', size=64, readonly=True, states={'draft': [('readonly', False)]}), + 'analytic_id': fields.many2one('account.analytic.account','Analytic Account', readonly=True, states={'draft': [('readonly', False)]}), + 'writeoff_amount': fields.function(_get_writeoff_amount, method=True, string='Writeoff Amount', type='float', readonly=True), } _defaults = { 'period_id': _get_period, @@ -205,6 +228,8 @@ class account_voucher(osv.osv): 'date': lambda *a: time.strftime('%Y-%m-%d'), 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.voucher',context=c), 'tax_id': _get_tax, + 'payment_option': 'without_writeoff', + 'comment': 'Write-Off', } def compute_tax(self, cr, uid, ids, context={}): @@ -638,7 +663,6 @@ class account_voucher(osv.osv): 'date': inv.date, 'date_maturity': inv.date_due } - if (debit == 0.0 or credit == 0.0 or debit+credit > 0) and (debit > 0.0 or credit > 0.0): master_line = move_line_pool.create(cr, uid, move_line) @@ -695,6 +719,10 @@ class account_voucher(osv.osv): if line.move_line_id.id: rec_ids = [master_line, line.move_line_id.id] rec_list_ids.append(rec_ids) + writeoff_account_id = False + writeoff_journal_id = False + writeoff_period_id = inv.period_id.id, + comment = False if not currency_pool.is_zero(cr, uid, inv.currency_id, line_total): diff = line_total @@ -718,6 +746,15 @@ class account_voucher(osv.osv): move_line['account_id'] = account_id move_line_pool.create(cr, uid, move_line) + for rec_ids in rec_list_ids: + if len(rec_ids) >= 2: + if inv.payment_option == 'with_writeoff': + writeoff_account_id = inv.writeoff_acc_id.id + writeoff_journal_id = inv.writeoff_journal_id.id + comment = inv.comment + move_line_pool.reconcile(cr, uid, rec_ids, 'manual', writeoff_account_id, writeoff_period_id, writeoff_journal_id, context) + else: + move_line_pool.reconcile_partial(cr, uid, rec_ids) self.write(cr, uid, [inv.id], { 'move_id': move_id, @@ -725,9 +762,6 @@ class account_voucher(osv.osv): 'number': name, }) move_pool.post(cr, uid, [move_id], context={}) - for rec_ids in rec_list_ids: - if len(rec_ids) >= 2: - move_line_pool.reconcile_partial(cr, uid, rec_ids) return True def copy(self, cr, uid, id, default={}, context=None): diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 83b6243a627..0d960e72f96 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -196,10 +196,29 @@
+ + + + + + + + + + - - - + + + + + @@ -304,10 +323,29 @@ + + + + + + + + + + - - - + + + + + diff --git a/addons/base_iban/base_iban.py b/addons/base_iban/base_iban.py index 92783b8eb74..b632e5f3e47 100644 --- a/addons/base_iban/base_iban.py +++ b/addons/base_iban/base_iban.py @@ -62,12 +62,12 @@ _ref_iban = { 'al':'ALkk BBBS SSSK CCCC CCCC CCCC CCCC', 'ad':'ADkk BBBB SSSS CC def _format_iban(string): ''' - This function removes all characters from given 'string' that isn't a alpha numeric and converts it to lower case. + This function removes all characters from given 'string' that isn't a alpha numeric and converts it to upper case. ''' res = "" for char in string: if char.isalnum(): - res += char.lower() + res += char.upper() return res class res_partner_bank(osv.osv): @@ -92,7 +92,7 @@ class res_partner_bank(osv.osv): for bank_acc in self.browse(cr, uid, ids): if not bank_acc.iban: continue - iban = _format_iban(bank_acc.iban) + iban = _format_iban(bank_acc.iban).lower() if iban[:2] in _iban_len and len(iban) != _iban_len[iban[:2]]: return False #the four first digits have to be shifted to the end diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml index ba05ee476a7..0018a7e2ce2 100644 --- a/addons/hr_expense/report/hr_expense_report_view.xml +++ b/addons/hr_expense/report/hr_expense_report_view.xml @@ -69,7 +69,7 @@ -