Commit Graph
440 Commits
Author SHA1 Message Date
Christophe Simonis 05e0bf3f1b [MERGE] forward port of branch saas-11 up to e7190cb 2016-07-06 00:03:49 +02:00
Christophe Simonis e7190cbbbf [MERGE] forward port of branch saas-10 up to 74b51d3 2016-07-05 23:42:12 +02:00
Christophe Simonis 74b51d3d97 [MERGE] forward port of branch 9.0 up to 489ea42 2016-07-05 23:19:50 +02:00
Nicolas Martinelli c4b82344d5 [FIX] account: traceback when getting counterparts
The compute method of the `counterpart` field only keeps a maximum of 2
account codes. However, it attempts to do [0:2] on a set, which is not
syntactically correct in Python.

opw-682373
2016-07-05 14:50:36 +02:00
Goffin Simon f7263dac30 [FIX] account: tax_line_move_line_get
The "else" has to be removed  because if a tax group named "X" is
the group of tax "A" and "B", the journal item corresponding to the invoice line
has the taxes "A", "B", and "X" set.

Introduced by 5a5ac1d7a5
2016-07-05 12:34:45 +02:00
qdp-odoo 549ea7a886 [FIX] account: cancelling a statement line that was reconciled with several already registered payment was crashing. Fixes opw 680128 2016-07-05 11:27:56 +02:00
qdp-odoo fb6a05d358 [FIX] account: fixed grouping of account.invoice.tax creation.
in details:
[FIX] added analytic account in grouping key of because we need to create different journal items for each of the lines having a different analytic account.
[REF] added a function on account.tax that returns the grouping key and that could be inherited in another (community) module
2016-07-05 10:22:35 +02:00
Goffin Simon 5a5ac1d7a5 [FIX] account: creation of an aml for an include base amount tax
When an account move line(aml) is created for an include base amount tax,
all the other taxes are impacted with this tax then the field tax_ids of
the created aml must contain the other taxes.

Example:
Considering an invoice line with:
 -A price=90
 -A fixed include base amount tax=10(incl_tax)
 -A 21% tax(called tax)

The base amount for the 21% tax is equal to:
100 = 90 + 10(incl_tax)

When the invoice is validated, three amls are created:

One for the product with:
 -Debit=90
 -Credit=0
 -Tax_ids=(incl_tax, tax)
 -Tax_line_id=()

One for the incl_tax with:
 -Debit=10
 -Credit=0
 -Tax_ids=(tax)
 -Tax_line_id=(incl_tax)

One for the tax with:
 -Debit=21
 -Credit=0
 -Tax_ids=()
 -Tax_line_id=(tax)

In this way, the base amount of 21% in the "Declaration periodique TVA"
report is the sum of all the amls balance(credit-debit) linked to tax with
the field Tax_ids.

opw:681102
2016-07-05 09:48:42 +02:00
Christophe Simonis 5a3a06f26f [MERGE] forward port of branch saas-11 up to d4d09df 2016-07-04 13:16:34 +02:00
Olivier Dony d4d09df143 [MERGE] Forward-port saas-10 up to f76f4cd0b6 2016-07-01 20:14:28 +02:00
Olivier Dony f76f4cd0b6 [MERGE] Forward-port 9.0 up to 7f2e748a22 2016-07-01 18:36:24 +02:00
Raphael Collet f4677cf2a6 [FIX] account, purchase: keep model 'mail.compose.message' transient 2016-07-01 16:04:55 +02:00
Olivier Dony 61a9cdc3f8 [FIX] account: fix unclear wording for Net EOM payment terms
The previous wording was inaccurate and made users think it
was impossible to setup "Net EOM" payment terms.

Updated POT file accordingly, but not PO files because this
requires a proper new translation.
2016-06-30 18:11:51 +02:00
Goffin Simon bdec480434 [FIX] account: _compute_base_amount
When computing the base amount of a tax, all the include base amount
taxes must be considered.

Closed #12481

opw:681102
2016-06-30 15:12:13 +02:00
Goffin Simon 1d843884e8 [FIX] account: Empty list with get_default function in "ir.values"
The function get_default in "ir.values" can return an empty list.
This is why checking that the result of this function is a list was not
enough.
2016-06-29 09:25:48 +02:00
Christophe Simonis 93e6316029 [MERGE] forward port of branch saas-11 up to 7153077 2016-06-28 18:05:25 +02:00
Christophe Simonis 5166fbd21b [MERGE] forward port of branch saas-10 up to 6d51bce 2016-06-28 15:12:06 +02:00
Christophe Simonis 841aa4e208 [MERGE] forward port of branch 9.0 up to 3e15b86 2016-06-28 14:10:35 +02:00
Martin Trigaux 5d9e4b7858 [FIX] account: performances of map_tax
break on first match instead of checking other Tax Source that will not match
anyway.
2016-06-28 13:23:41 +02:00
Mahendra barad 6ba6213fa9 [ADD] account_taxcloud: Integrate TaxCloud API to get Sales Tax
- add a new checkbox on fiscal position: TaxCloud API
- when computing this fiscal position, it will:
        - return an existing tax if one exists for the same tax
          percentage, state, zip and TIC Category
        - or create and return this tax if it does not exists yet
- Create a data fiscal position: country U.S., tax cloud API
- In l10n_us, add a settings in accounting: compute tax automatically using tax cloud.

NB:
- The signature of map_tax has been modified to optionally specify the product
  and the partner on which the tax is applied
- The avoid the validationerrors that may occur while evaluation the tax with Taxcloud
  when a public user is on the frontend shop (website_sale), we have to execute the
  error silently by logging it.
2016-06-28 12:12:30 +02:00
Martin Trigaux cc4f8df99f [FIX] account: compute total invoice in batch
The computation of the total_invoiced field did not work in batch mode.
When displaying a company in a form view (field invoice_total comptued), the
children of this company are present in the cache and the value of the field
invoice_total will be prefetched for these children as well (at least in 9.0).
Most of the time this is redudant information and the same value is computed
for each child while most of the invoices are on the parent.

Batching the computation per partner allows to make one global query for all
partners.

Add test to make sure the total increase correctly after a test invoice
confirmation.
2016-06-27 17:20:05 +02:00
Stéphane Bidoul e30ea5647d [IMP] account: adding the invoice.tax.line id in tax_line_move_line_get() to allow inheritance.
Was PR #12576. Courtesy from sbidoul
2016-06-27 10:55:07 +02:00
qdp-odoo 0a6afa1ff1 [FIX] account: grouping tax lines on invoices when no tax account is set on them. Fixes #12561 2016-06-27 10:55:07 +02:00
qdp-odoo b8a58caad1 [FIX] account: in the bank statement reconciliation widget, don't convert amounts using the amount_currency to the target currency if the target currency is the compmany currency. OPW 680854 2016-06-22 08:25:17 +02:00
Christophe Simonis da53a27a5d [MERGE] forward port of branch saas-11 up to c88c70e 2016-06-21 16:24:38 +02:00
Goffin Simon e049506b70 [FIX] account: _prepare_reconciliation_move_line
float_is_zero(value1-value2) is not equivalent to
float_compare(value1,value2) == 0, as the former will round after
computing the difference, while the latter will round before

opw:678588
2016-06-21 14:14:39 +02:00
Christophe Simonis c88c70e900 [MERGE] forward port of branch saas-10 up to d73f0d8 2016-06-21 13:58:24 +02:00
Christophe Simonis d73f0d8063 [MERGE] forward port of branch saas-9 up to 68f5163 2016-06-21 12:42:34 +02:00
Christophe Simonis 68f51630b9 [MERGE] forward port of branch 9.0 up to e8827d0 2016-06-21 12:16:53 +02:00
Christophe Simonis 91e04da933 [MERGE] forward port of branch 9.0 up to e37ba61 2016-06-20 14:28:20 +02:00
Goffin Simon 6101b856f0 [FIX] Wrong amount currency in account move line
When computing the amount currency, the date must be set in the context
to use the right currency rate.

opw:680693
2016-06-20 14:20:53 +02:00
Christophe Simonis e37ba61832 [MERGE] forward port of branch saas-6 up to b87a93a 2016-06-20 14:20:03 +02:00
Joren Van Onder 8a761721d1 [IMP] payment: add options to automatically confirm SO's through website
Introduces two new options:
- confirm_so: to confirm the sale order on acquirer confirmation
- generate_and_pay_invoice: confirm_so + generation of invoice and
                            payment registration
2016-06-17 13:09:18 +02:00
Christophe Simonis 10148c3c3a [MERGE] forward port of branch saas-9 up to 8ddf1b9 2016-06-17 12:24:47 +02:00
Christophe Simonis 8ddf1b909a [MERGE] forward port of branch 9.0 up to 8284c73 2016-06-17 11:32:09 +02:00
Goffin Simon 225023f1d1 [FIX] account: Wrong "amount_currency" in account move line after reconciliation
Use case:
-enable multi currency (use UDS as company currency and EUR as secondary currency)
-create account account in a different currency (EUR)
-create journal for the bank account in EUR
-create a new tax included tax
-create a new bank statement in EUR journal and add one line
-reconcile
-Choose a counterpart with the included tax and click on reconcile

Before the fix:
After reconciliation the amount_currency for tax and expense were wrong.
You could check this in the journal items linked to the bank statement.

Video:https://youtu.be/678rFb4OE2Q

opw:680693
2016-06-17 09:18:39 +02:00
Cedric Snauwaert b350ee65a4 [FIX] account: speed optimization of dashboard
when there are too many unreconciled entries, showing dashboard is really slow, switch the computation of unreconciled entries to SQL
2016-06-16 16:44:30 +02:00
Cedric Snauwaert 6b1bff4ee9 [FIX] account: fix condition to create exchange_rate_entries, in some case we don't want to create one
Typically when sum(debit) = sum(credit) and sum(amount_currency) = 0
2016-06-16 16:12:45 +02:00
qdp-odoo a59703e652 [FIX] account: on opening of bank statement reconciliation widget, don't make automatic reconciliation if we have only one open invoice but also an unreconciled payment line (blue line) with the same amount 2016-06-16 14:30:20 +02:00
qdp-odoo 26dfe8944d [FIX] account: in bank statement reconciliation widget, searching on a given amount now also return blue lines with that amount (previously it was only looking on payable/receivable lines) 2016-06-16 14:26:46 +02:00
Denis Ledoux 9114d36414 [FIX] account: statement_id write on multiple journal items
Before this revision, this was not possible to write
`statment_id` on multiple journal items at a time,
as the condition:
`if 'statement_id' in vals and self.payment_id:`

required `self` to contains only one record
2016-06-16 12:22:42 +02:00
Denis Ledoux fad2dc8ac4 [FIX] account: statement line reconciliation cancel
On the cancelation of a bank statement line
reconciled with journal items created
by the registering a payment, in addition to unbind
the move with the statement line, the statement must be
unbind from the move, and the payment must be reset
to posted.

opw-680128
2016-06-16 10:27:23 +02:00
Christophe Simonis 9fe4cf5f72 [MERGE] forward port of branch saas-11 up to dda0d3d
# Conflicts:
#	addons/product_uos/i18n/lo.po
#	addons/sales_team/models/__init__.py
#	addons/website_payment/views/website_payment_templates.xml
#	addons/website_portal_sale/views/templates.xml
#	openerp/addons/base/ir/ir_qweb.py
2016-06-15 13:10:45 +02:00
Christophe Simonis dda0d3d62d [MERGE] forward port of branch saas-10 up to baf494c
# Conflicts:
#	addons/hr_timesheet/project_timesheet.py
#	addons/sale_layout/i18n/es_PE.po
#	addons/sale_layout/i18n/hu.po
#	addons/sale_layout/i18n/lo.po
#	addons/sale_layout/i18n/pl.po
#	addons/sale_service/i18n/es_MX.po
#	addons/sale_service/i18n/es_PE.po
#	addons/sale_service/i18n/lo.po
#	addons/stock/stock.py
#	addons/stock/stock_view.xml
#	addons/warning/i18n/es_PE.po
#	addons/warning/i18n/lo.po
#	addons/warning/i18n/ru.po
#	addons/web/i18n/cs.po
#	addons/web/i18n/ja.po
#	addons/web/i18n/lo.po
#	addons/web/i18n/th.po
2016-06-15 12:59:39 +02:00
Christophe Simonis baf494c67b [MERGE] forward port of branch saas-9 up to 1d81bb0
# Conflicts:
#	addons/account_extra_reports/i18n/ca.po
#	addons/account_extra_reports/i18n/fi.po
#	addons/account_extra_reports/i18n/pl.po
#	addons/account_extra_reports/i18n/te.po
#	addons/account_extra_reports/i18n/zh_CN.po
#	addons/account_full_reconcile/i18n/hu.po
#	addons/account_full_reconcile/i18n/pl.po
#	addons/crm/crm_lead_menu.xml
#	addons/crm_claim/i18n/es_PE.po
#	addons/crm_claim/i18n/hu.po
#	addons/crm_claim/i18n/ja.po
#	addons/crm_claim/i18n/pl.po
#	addons/delivery/views/delivery_view.xml
#	addons/product/product_view.xml
#	addons/project_timesheet/i18n/es_PE.po
#	addons/stock/stock_view.xml
2016-06-15 12:40:59 +02:00
Christophe Simonis f9072c789d [MERGE] forward port of branch 9.0 up to bfbe2d6
# Conflicts:
#	addons/marketing/i18n/es_PE.po
#	addons/marketing/i18n/hu.po
2016-06-14 19:27:16 +02:00
Denis Ledoux 5d774f4221 [FIX] account: statement line reconciliation cancel
Cancelling a statement line should not remove the
according journal items if they are associated
to an `account.payment`.

In this case, this should simply remove
the `statement_id` of the move lines,
and unmark the `account.payment` as
reconciled.

opw-674896
2016-06-14 17:54:13 +02:00
Denis Ledoux c95e46eedb [FIX] account: invoice reset to draft when the default report is removed
When the report `account.report_invoice` was being deleted,
it was no longer possible to reset an invoice to draft.

This is related to revision
291561a197
2016-06-13 19:00:03 +02:00
Denis Ledoux 3b4560cf42 [FIX] account: multiple journal items to fix in full batch reconciling
In a batch reconciliation of journal items,
it could happen that multiple journal items
in a foreign currency required the creation
of an exchange entry
`aml_to_balance_currency |= aml`

But the statement `aml.matched_debit_ids[0] or aml.matched_credit_ids[0]`
requires a single browse record (singleton) to work

The partial  reconciliation is supposed to be the same for all
the journal items to fix, we can therefore safely do
`aml = aml_to_balance_currency[0]` to overcome this issue.

In addition, in this condition, the full reconcile must be
skipped to avoid passing multiple times in the `create_exchange_rate_entry`
method (which is called in the method `create` of `account.partial.reconcile`

This has been reviewed by qdp.

opw-680044
2016-06-13 17:20:48 +02:00
Goffin Simon 96621a3427 [FIX] account: deleting a default tax(ir.values)
When a chart of account is created, ir.values for the fields taxes_id
and supplier_taxes_id in the model 'product.template' are created.
But if one of this two taxes are deleted, there was a crash when
creating a new product template because the default tax was missing.

opw:680576
2016-06-13 17:00:16 +02:00