diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 42f3effd6f9..06e59232ac9 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -114,7 +114,7 @@ class account_invoice(osv.osv): #we check if the invoice is partially reconciled and if there are other invoices #involved in this partial reconciliation (and we sum these invoices) for line in aml.reconcile_partial_id.line_partial_ids: - if line.invoice: + if line.invoice and invoice.type == line.invoice.type: nb_inv_in_partial_rec += 1 #store the max invoice id as for this invoice we will make a balance instead of a simple division max_invoice_id = max(max_invoice_id, line.invoice.id) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 0ef39d5884d..48d6320fbc3 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1451,7 +1451,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 997b2b03bb6..0bbdb959d17 100644 --- a/addons/account/static/src/js/account_move_line_quickadd.js +++ b/addons/account/static/src/js/account_move_line_quickadd.js @@ -22,6 +22,7 @@ openerp.account.quickadd = function (instance) { start:function(){ var tmp = this._super.apply(this, arguments); var self = this; + var defs = []; this.$el.parent().prepend(QWeb.render("AccountMoveLineQuickAdd", {widget: this})); this.$el.parent().find('.oe_account_select_journal').change(function() { @@ -41,11 +42,17 @@ openerp.account.quickadd = function (instance) { 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) { + defs.push(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; + })); + defs.push(mod.call("list_journals", []).then(function(result) { + self.journals = result; + })); + defs.push(mod.call("list_periods", []).then(function(result) { + self.periods = result; + })); + return $.when(tmp, defs); }, do_search: function(domain, context, group_by) { var self = this; @@ -53,34 +60,27 @@ openerp.account.quickadd = function (instance) { this.last_context = context; this.last_group_by = group_by; this.old_search = _.bind(this._super, this); - var mod = new instance.web.Model("account.move.line", context, domain); - return $.when(mod.call("list_journals", []).then(function(result) { - self.journals = result; - }),mod.call("list_periods", []).then(function(result) { - self.periods = result; - })).then(function () { - var o; - 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){ - self.current_journal_type = self.journals[i][2]; - self.current_journal_currency = self.journals[i][3]; - self.current_journal_analytic = self.journals[i][4]; - $(o).attr('selected',true); - } - self.$el.parent().find('.oe_account_select_journal').append(o); + var o; + 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){ + self.current_journal_type = self.journals[i][2]; + self.current_journal_currency = self.journals[i][3]; + self.current_journal_analytic = self.journals[i][4]; + $(o).attr('selected',true); } - 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); - } - self.$el.parent().find('.oe_account_select_period').val(self.current_period).attr('selected',true); - return self.search_by_journal_period(); - }); + 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); + } + self.$el.parent().find('.oe_account_select_period').val(self.current_period).attr('selected',true); + return self.search_by_journal_period(); }, search_by_journal_period: function() { var self = this; @@ -93,7 +93,9 @@ openerp.account.quickadd = function (instance) { 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; - return self.old_search(new instance.web.CompoundDomain(self.last_domain, domain), self.last_context, self.last_group_by); + var compound_domain = new instance.web.CompoundDomain(self.last_domain, domain); + self.dataset.domain = compound_domain.eval(); + return self.old_search(compound_domain, self.last_context, self.last_group_by); }, }); }; diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index faf4e29c93c..ec5e2c56e6c 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -664,13 +664,20 @@ class account_analytic_account(osv.osv): partner_payment_term = contract.partner_id.property_payment_term and contract.partner_id.property_payment_term.id or False + currency_id = False + if contract.pricelist_id: + currency_id = contract.pricelist_id.currency_id.id + elif contract.partner_id.property_product_pricelist: + currency_id = contract.partner_id.property_product_pricelist.currency_id.id + elif contract.company_id: + currency_id = contract.company_id.currency_id.id inv_data = { 'reference': contract.code or False, 'account_id': contract.partner_id.property_account_receivable.id, 'type': 'out_invoice', 'partner_id': contract.partner_id.id, - 'currency_id': contract.partner_id.property_product_pricelist.id or False, + 'currency_id': currency_id, 'journal_id': len(journal_ids) and journal_ids[0] or False, 'date_invoice': contract.recurring_next_date, 'origin': contract.name, diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index c9516b6135f..5d0ed8297c2 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -911,9 +911,10 @@ class account_voucher(osv.osv): if context.get('payment_expected_currency') and currency_id != context.get('payment_expected_currency'): vals['value']['amount'] = 0 amount = 0 - res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context) - for key in res.keys(): - vals[key].update(res[key]) + if partner_id: + res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context) + for key in res.keys(): + vals[key].update(res[key]) return vals def button_proforma_voucher(self, cr, uid, ids, context=None): @@ -965,7 +966,7 @@ class account_voucher(osv.osv): res = {} if not partner_id: return res - res = {'account_id':False} + res = {} partner_pool = self.pool.get('res.partner') journal_pool = self.pool.get('account.journal') if pay_now == 'pay_later': @@ -977,7 +978,8 @@ class account_voucher(osv.osv): account_id = partner.property_account_payable.id else: account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id - res['account_id'] = account_id + if account_id: + res['account_id'] = account_id return {'value':res} def _sel_context(self, cr, uid, voucher_id, context=None): @@ -1366,6 +1368,7 @@ class account_voucher(osv.osv): move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') for voucher in self.browse(cr, uid, ids, context=context): + local_context = dict(context, force_company=voucher.journal_id.company_id.id) if voucher.move_id: continue company_currency = self._get_company_currency(cr, uid, voucher.id, context) @@ -1380,7 +1383,7 @@ class account_voucher(osv.osv): # Get the name of the account_move just created name = move_pool.browse(cr, uid, move_id, context=context).name # Create the first line of the voucher - move_line_id = move_line_pool.create(cr, uid, self.first_move_line_get(cr,uid,voucher.id, move_id, company_currency, current_currency, context), context) + move_line_id = move_line_pool.create(cr, uid, self.first_move_line_get(cr,uid,voucher.id, move_id, company_currency, current_currency, local_context), local_context) move_line_brw = move_line_pool.browse(cr, uid, move_line_id, context=context) line_total = move_line_brw.debit - move_line_brw.credit rec_list_ids = [] @@ -1392,9 +1395,9 @@ class account_voucher(osv.osv): line_total, rec_list_ids = self.voucher_move_line_create(cr, uid, voucher.id, line_total, move_id, company_currency, current_currency, context) # Create the writeoff line if needed - ml_writeoff = self.writeoff_move_line_get(cr, uid, voucher.id, line_total, move_id, name, company_currency, current_currency, context) + ml_writeoff = self.writeoff_move_line_get(cr, uid, voucher.id, line_total, move_id, name, company_currency, current_currency, local_context) if ml_writeoff: - move_line_pool.create(cr, uid, ml_writeoff, context) + move_line_pool.create(cr, uid, ml_writeoff, local_context) # We post the voucher. self.write(cr, uid, [voucher.id], { 'move_id': move_id, @@ -1605,7 +1608,11 @@ class account_bank_statement(osv.osv): bank_st_line_obj = self.pool.get('account.bank.statement.line') st_line = bank_st_line_obj.browse(cr, uid, st_line_id, context=context) if st_line.voucher_id: - voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, context=context) + voucher_obj.write(cr, uid, [st_line.voucher_id.id], + {'number': next_number, + 'date': st_line.date, + 'period_id': st_line.statement_id.period_id.id}, + context=context) if st_line.voucher_id.state == 'cancel': voucher_obj.action_cancel_draft(cr, uid, [st_line.voucher_id.id], context=context) voucher_obj.signal_proforma_voucher(cr, uid, [st_line.voucher_id.id]) diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index e35061e1836..97f96f75901 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -73,8 +73,14 @@ - + + + + + @@ -112,15 +118,6 @@ - - - - - - @@ -224,11 +221,11 @@

- + diff --git a/addons/account_voucher/wizard/account_statement_from_invoice.py b/addons/account_voucher/wizard/account_statement_from_invoice.py index de5121a819b..059989801d1 100644 --- a/addons/account_voucher/wizard/account_statement_from_invoice.py +++ b/addons/account_voucher/wizard/account_statement_from_invoice.py @@ -94,7 +94,7 @@ class account_statement_from_invoice_lines(osv.osv_memory): 'account_id': result['value'].get('account_id', statement.journal_id.default_credit_account_id.id), 'company_id': statement.company_id.id, 'currency_id': statement.currency.id, - 'date': line.date, + 'date': statement.date, 'amount': sign*amount, 'payment_rate': result['value']['payment_rate'], 'payment_rate_currency_id': result['value']['payment_rate_currency_id'], @@ -119,7 +119,7 @@ class account_statement_from_invoice_lines(osv.osv_memory): 'statement_id': statement_id, 'ref': line.ref, 'voucher_id': voucher_id, - 'date': time.strftime('%Y-%m-%d'), + 'date': statement.date, }, context=context) return {'type': 'ir.actions.act_window_close'} diff --git a/addons/analytic_contract_hr_expense/i18n/ja.po b/addons/analytic_contract_hr_expense/i18n/ja.po new file mode 100644 index 00000000000..2f2b5c3dd6a --- /dev/null +++ b/addons/analytic_contract_hr_expense/i18n/ja.po @@ -0,0 +1,72 @@ +# Japanese translation for openobject-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2014-02-21 02:29+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-02-21 05:48+0000\n" +"X-Generator: Launchpad (build 16916)\n" + +#. module: analytic_contract_hr_expense +#: view:account.analytic.account:0 +msgid "or view" +msgstr "または参照" + +#. module: analytic_contract_hr_expense +#: view:account.analytic.account:0 +msgid "Nothing to invoice, create" +msgstr "" + +#. module: analytic_contract_hr_expense +#: view:account.analytic.account:0 +msgid "expenses" +msgstr "経費" + +#. module: analytic_contract_hr_expense +#: model:ir.model,name:analytic_contract_hr_expense.model_account_analytic_account +msgid "Analytic Account" +msgstr "分析勘定" + +#. module: analytic_contract_hr_expense +#: code:addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py:144 +#, python-format +msgid "Expenses to Invoice of %s" +msgstr "" + +#. module: analytic_contract_hr_expense +#: code:addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py:136 +#, python-format +msgid "Expenses of %s" +msgstr "%sの経費" + +#. module: analytic_contract_hr_expense +#: field:account.analytic.account,expense_invoiced:0 +#: field:account.analytic.account,expense_to_invoice:0 +#: field:account.analytic.account,remaining_expense:0 +msgid "unknown" +msgstr "不明" + +#. module: analytic_contract_hr_expense +#: field:account.analytic.account,est_expenses:0 +msgid "Estimation of Expenses to Invoice" +msgstr "請求対象経費見込" + +#. module: analytic_contract_hr_expense +#: field:account.analytic.account,charge_expenses:0 +msgid "Charge Expenses" +msgstr "経費請求" + +#. module: analytic_contract_hr_expense +#: view:account.analytic.account:0 +msgid "⇒ Invoice" +msgstr "⇒ 請求" diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 159baf3a9e7..ca4a15bca6e 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -268,10 +268,14 @@ def log_fct(cr, uid_orig, model, method, fct_src, *args, **kw): new_values = get_data(cr, uid_orig, pool, res_ids, model, method) elif method == 'read': res = fct_src(cr, uid_orig, model.model, method, *args, **kw) + if isinstance(res, dict): + records = [res] + else: + records = res # build the res_ids and the old_values dict. Here we don't use get_data() to # avoid performing an additional read() res_ids = [] - for record in res: + for record in records: res_ids.append(record['id']) old_values[(model.id, record['id'])] = {'value': record, 'text': record} # log only the fields read @@ -279,7 +283,9 @@ def log_fct(cr, uid_orig, model, method, fct_src, *args, **kw): elif method == 'unlink': res_ids = args[0] old_values = get_data(cr, uid_orig, pool, res_ids, model, method) - res = fct_src(cr, uid_orig, model.model, method, *args, **kw) + # process_data first as fct_src will unlink the record + self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list) + return fct_src(cr, uid_orig, model.model, method, *args, **kw) else: # method is write, action or workflow action res_ids = [] if args: @@ -322,7 +328,7 @@ def get_data(cr, uid, pool, res_ids, model, method): data = {} resource_pool = pool[model.model] # read all the fields of the given resources in super admin mode - for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids): + for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids, resource_pool._all_columns): values = {} values_text = {} resource_id = resource['id'] @@ -456,7 +462,9 @@ def process_data(cr, uid, pool, res_ids, model, method, old_values=None, new_val # if at least one modification has been found for model_id, resource_id in lines: - name = pool[model.model].name_get(cr, uid, [resource_id])[0][1] + line_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, model_id).model + name = pool.get(line_model).name_get(cr, uid, [resource_id])[0][1] + vals = { 'method': method, 'object_id': model_id, diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index e660fd8363b..53a6ffd5462 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -25,7 +25,7 @@ def fragment_to_query_string(func): return """ - + + @@ -140,8 +141,8 @@
  • Contact us
    • -
    • -
    • +
    • +

    @@ -249,7 +250,7 @@ - + @@ -261,10 +262,10 @@ - + @@ -383,13 +384,13 @@ @@ -673,10 +674,10 @@ Sitemap: sitemap.xml