diff options
| author | qdp-launchpad@tinyerp.com <> | 2010-11-26 17:04:54 +0100 |
|---|---|---|
| committer | qdp-launchpad@tinyerp.com <> | 2010-11-26 17:04:54 +0100 |
| commit | 4d2e3cb5ad0807bf14f8081a7c7afc2abf0a9202 (patch) | |
| tree | e9f1389a97a9b611356193e25d896ff2e096f5ef /addons | |
| parent | 4d0ee449629da254752a60f237d903e0ff1d9985 (diff) | |
| parent | 382f6fc8c55cb866c4bc8d54c7a4b13694648d46 (diff) | |
[MERGE] merged the dev3 branch
bzr revid: qdp-launchpad@tinyerp.com-20101126160454-7h9jwvqih2ds0va5
Diffstat (limited to 'addons')
54 files changed, 456 insertions, 50 deletions
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 @@ <menuitem id="menu_finance_periodical_processing_billing" name="Billing" parent="menu_finance_periodical_processing" sequence="35"/> <menuitem id="menu_finance_statistic_report_statement" name="Statistic Reports" parent="menu_finance_reporting" sequence="300"/> - + <menuitem id="next_id_22" name="Partners" parent="menu_finance_generic_reporting" sequence="1"/> <menuitem parent="account.menu_finance_legal_statement" id="final_accounting_reports" diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 93d5c37bd08..307ab1f58da 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -82,7 +82,7 @@ class account_move_line(osv.osv): periods = fiscalperiod_obj.search(cr, uid, [('date_start', '<', first_period.date_start)]) periods = ','.join([str(x) for x in periods]) if periods: - query = obj+".state <> '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 @@ <group col="7" colspan="4"> <field name="name" select="1"/> <field name="date" select="1" on_change="onchange_date(date)"/> - <field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" select="1"/> + <field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" widget="selection"/> <newline/> <field name="period_id"/> <field name="balance_start"/> <field name="balance_end_real"/> <field name="currency" invisible="1"/> + <field name="account_id" invisible="1"/> </group> <notebook colspan="4"> <page string="Journal Entries"> - <field colspan="4" name="move_line_ids" nolabel="1" widget="many2many"/> + <field colspan="4" name="move_line_ids" nolabel="1" widget="many2many" domain="[('account_id','=',account_id),('statement_id', '=', False)]"> + <tree string="Statement lines"> + <field name="date"/> + <field name="period_id"/> + <field name="journal_id"/> + <field name="ref"/> + <field name="name"/> + <field name="account_id"/> + <field name="partner_id"/> + <field name="debit"/> + <field name="credit"/> + </tree> + </field> </page> </notebook> <group col="8" colspan="4"> @@ -1155,7 +1168,7 @@ <filter icon="terp-dolar_ok!" string="Unreconciled" - domain="[('reconcile_id','=',False), ('account_id.type','in',['receivable', 'payable'])]" help="Unreconciled Journal Items" + domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help="Unreconciled Journal Items" name="unreconciled"/> <separator orientation="vertical"/> <field name="move_id" select="1" string="Number (Move)"/> 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<openerp> - <data> - <menuitem id="next_id_22" name="Partners" parent="menu_finance_generic_reporting" sequence="1"/> - - </data> -</openerp> 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 @@ -407,6 +407,11 @@ 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" msgstr "" 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 @@ -27,6 +27,11 @@ 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 msgid "Unpaid Supplier Invoices" 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 @@ -27,6 +27,11 @@ 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 msgid "Unpaid Supplier Invoices" 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 @@ -28,6 +28,11 @@ 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 msgid "Unpaid Supplier Invoices" 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 @@ -29,6 +29,11 @@ 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" msgstr "" 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 @@ -29,6 +29,11 @@ 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" msgstr "" 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 @@ -22,6 +22,11 @@ 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" msgstr "Konto maksukood" 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 @@ -30,6 +30,11 @@ 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" msgstr "" 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 @@ -23,6 +23,11 @@ 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 #: field:account.partner.ledger,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 @@ -28,6 +28,11 @@ 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 msgid "Unpaid Supplier Invoices" 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 @@ -26,6 +26,11 @@ 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" msgstr "" 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 @@ -25,6 +25,11 @@ 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" msgstr "" 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 @@ -22,6 +22,11 @@ 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" msgstr "Šifra PDV obrasca" 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 @@ -29,6 +29,11 @@ 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" msgstr "" 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 @@ -30,6 +30,11 @@ 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" msgstr "" 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 @@ -23,6 +23,11 @@ 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 #: field:account.partner.ledger,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 @@ -23,6 +23,11 @@ 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 #: field:account.partner.ledger,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 @@ -22,6 +22,11 @@ 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" msgstr "Sąskaitos mokesčio kodas" 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 @@ -23,6 +23,11 @@ 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 #: field:account.partner.ledger,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 @@ -23,6 +23,11 @@ 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" msgstr "Татварын дансны код" 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 @@ -23,6 +23,11 @@ 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" msgstr "" 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 @@ -27,6 +27,11 @@ 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 #: field:account.partner.ledger,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 @@ -23,6 +23,11 @@ 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" msgstr "Facturas provesidor en espèra de règlament" 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 @@ -35,6 +35,11 @@ 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" msgstr "" 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 @@ -3861,6 +3861,11 @@ 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 msgid "All Entries" 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 @@ -29,6 +29,11 @@ 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" msgstr "" 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 @@ -30,6 +30,11 @@ 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" msgstr "" 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 @@ -28,6 +28,11 @@ 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 msgid "Unpaid Supplier Invoices" 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 @@ -30,6 +30,11 @@ 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" msgstr "" 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 @@ -33,6 +33,11 @@ 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" msgstr "" 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 @@ -35,6 +35,11 @@ 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" msgstr "" 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 @@ -34,6 +34,11 @@ 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" msgstr "" 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 @@ -30,6 +30,11 @@ 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" msgstr "" 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 @@ -29,6 +29,11 @@ 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" msgstr "" 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 @@ -27,6 +27,11 @@ 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 msgid "Unpaid Supplier Invoices" 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 @@ -28,6 +28,11 @@ 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 msgid "Unpaid Supplier Invoices" 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 @@ -28,6 +28,11 @@ 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" msgstr "" 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 @@ <field name="inherit_id" ref="account.view_account_journal_form"/> <field name="arch" type="xml"> <field name="sequence_id" position="after"> - <field name="internal_sequence"/> + <field name="internal_sequence_id"/> </field> </field> </record> 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 @@ <?xml version="1.0" encoding="utf-8"?> <openerp> <data> - <!--Account Journal Internal Sequences--> - <record id="internal_sequence_journal" model="ir.sequence"> - <field name="name">Internal Sequence Journal</field> - <field name="code">account.journal</field> - <field name="number_next">1</field> - </record> - - <function eval="('default', False, 'internal_sequence', [('account.journal', False)], internal_sequence_journal, True, False, False, False, True)" id="internal_seq_default_set" model="ir.values" name="set"/> <!--Account Journal Internal Number of account move line--> 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 (<http://tiny.be>). +# +# 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 <http://www.gnu.org/licenses/>. +# +############################################################################## + +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 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="view_account_sequence_installer" model="ir.ui.view"> + <field name="name">account.sequence.installer.view</field> + <field name="model">account.sequence.installer</field> + <field name="type">form</field> + <field name="inherit_id" ref="base.res_config_installer"/> + <field name="arch" type="xml"> + <data> + <form position="attributes"> + <attribute name="string">Account Sequence Application Configuration</attribute> + </form> + <separator string="title" position="attributes"> + <attribute name="string">Configure Your Account Sequence Application</attribute> + </separator> + <xpath expr='//separator[@string="vsep"]' position='attributes'> + <attribute name='string'></attribute> + </xpath> + <xpath expr="//label[@string='description']" position="attributes"> + <attribute name="string">You can enhance the Account Sequence Application by installing .</attribute> + </xpath> + <group colspan="8"> + <field name="name" colspan="4"/> + <field name="prefix"/> + <field name="suffix"/> + <field name="number_next"/> + <field name="number_increment"/> + <field name="padding"/> + <field name="company_id" groups="base.group_multi_company"/> + </group> + <xpath expr="//button[@string='Install Modules']" position="attributes"> + <attribute name="string">Configure</attribute> + </xpath> + </data> + </field> + </record> + + <record id="action_account_seq_installer" model="ir.actions.act_window"> + <field name="name">Account Sequence Application Configuration</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.sequence.installer</field> + <field name="view_id" ref="view_account_sequence_installer"/> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <record id="account_seq_installer_todo" model="ir.actions.todo"> + <field name="action_id" ref="action_account_seq_installer"/> + <field name="sequence">3</field> + <field name="restart">onskip</field> + </record> + + </data> +</openerp> 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 @@ <field name="narration" colspan="2" nolabel="1"/> </group> <group col="2" colspan="1"> + <group col="2" colspan="1"> + <separator string="Payment Options" colspan="2"/> + <field name="payment_option" required="1"/> + <field name="writeoff_amount" + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> + <field name="writeoff_acc_id" + attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}" + domain="[('type','=','liquidity')]"/> + <!-- should select income accounts only. Or use the journal for this ? --> + <field name="writeoff_journal_id" + attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"/> + <field name="comment" + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> + <field name="analytic_id" + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" + groups="analytic.group_analytic_accounting"/> + </group> <separator string="Other Information" colspan="2"/> - <field name="date" select="1" on_change="onchange_date(date)"/> - <field name="currency_id" invisible="True"/> - <field name="number"/> + <group col="4" colspan="1"> + <field name="date" select="1" on_change="onchange_date(date)"/> + <field name="currency_id" invisible="True"/> + <field name="number"/> + </group> </group> </page> <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}"> @@ -304,10 +323,29 @@ <field name="narration" colspan="2" nolabel="1"/> </group> <group col="2" colspan="1"> + <group col="2" colspan="1"> + <separator string="Payment Options" colspan="2"/> + <field name="payment_option" required="1"/> + <field name="writeoff_amount" + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> + <field name="writeoff_acc_id" + attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}" + domain="[('type','=','liquidity')]"/> + <!-- should select income accounts only. Or use the journal for this ? --> + <field name="writeoff_journal_id" + attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"/> + <field name="comment" + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> + <field name="analytic_id" + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" + groups="analytic.group_analytic_accounting"/> + </group> <separator string="Other Information" colspan="2"/> - <field name="date" select="1" on_change="onchange_date(date)"/> - <field name="currency_id" invisible="True"/> - <field name="number"/> + <group col="4" colspan="1"> + <field name="date" select="1" on_change="onchange_date(date)"/> + <field name="currency_id" invisible="True"/> + <field name="number"/> + </group> </group> </page> <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}"> 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 @@ <filter string="Approved" icon="terp-check" domain="[('state','=','accepted')]" help = "Approved Expenses"/> <separator orientation="vertical"/> - <filter string="Invoiced" icon="terp-dolar" domain="[('state','=','invoiced')]" + <filter string="Invoiced" icon="terp-dolar" domain="[('state','in', ('invoiced', 'paid'))]" help = "Invoiced Expenses"/> <separator orientation="vertical"/> <field name="employee_id"/> |
