Commit Graph

439 Commits

Author SHA1 Message Date
Goffin Simon d9f92ba160 [FIX] account: included tax with fiscal position
When creating an invoice with a fiscal position(fp) which maps an included tax(itax)
to an excluded tax(etax). Each invoice line mapped by fp must recompute its unit price
to substract the included tax.
Inspired from 503820a

Closes #9811

opw:658109
2015-12-02 16:47:51 +01:00
Denis Ledoux 802d1abe7a [FIX] account: invoice lines amounts must be rounded when converted to journal items
This revision is related to cfbd086b09.
This is the same use case than above, but with a different
currency than the one of the company, for the field
`amount_currency` this time.

Closes #8135
opw-647639
2015-08-24 18:18:01 +02:00
Denis Ledoux cfbd086b09 [FIX] account: invoice lines to journal entries currency rounding
When converting an invoice in journal entries,
the invoice lines amounts must be currency rounded
not only when the invoice currency is different
than the company invoice,
but also when they are the same.

Otherwise, a rounding issue can happen
if the `Account` decimal accuracy is greater
than the currency rounding, the journal entries
total and the invoice total could be different.

e.g.
 - Set decimal accuracy of Account and product to 4
 - Create a supplier invoice, any supplier
 - Add a line as follow:
   - Product: None
   - Quantity: 2057
   - Price unit: 11.9150
   - Tax: 16% (create a new tax with 0.16 as percentage)
 - Validate the invoice
 - In the other information tab of the invoice,
   click on the journal entry
 - Notice that the first line has as credit amount 28430.6150
   While the invoice total is 28430.6200
 - Now if you try to create a bank statement with one line
   of -28430.6200 and as partner the supplier you chose
   in the second step of this explanation, and try
   to reconciliate it to the invoice created above,
   the above won't be marked as paid, while it should.

opw-647639
Fixes #8135
2015-08-19 18:21:00 +02:00
Goffin Simon 4f6eebf698 [FIX] account: tax sign
Division by 0 introduced by c525c6712a
2015-08-05 19:03:15 +02:00
Goffin Simon c525c6712a [FIX] account: tax sign
When changing manually the the amount of tax in supplier invoice,
the tax sign of the tax must be kept.

opw:645691
2015-08-05 16:10:37 +02:00
Goffin Simon 663be8118f [FIX] account: tax sign in supplier invoice
When changing manually the the amount of tax in supplier invoice,
the tax sign of the tax must be kept.

opw:645691
2015-08-05 10:30:11 +02:00
Leonardo Pistone 02ae76ce0b [FIX] account: type builtin used as a local variable
Close #6901
2015-07-07 12:47:13 +02:00
Christophe Simonis 066e41b63d [MERGE] forward port of branch saas-3 up to 31f2a1b 2015-06-30 13:33:35 +02:00
Christophe Simonis 31f2a1bc38 [MERGE] forward port of branch 7.0 up to 1c0bc7c 2015-06-30 12:47:27 +02:00
Nicolas Martinelli a197c91458 [FIX] account: remove lang from context before move creation
If an error message pops up during the move creation, we have to take the
user's language and not the partner's language.

Fixes #6902
Closes #6903
2015-06-26 08:41:10 +02:00
Christophe Simonis ed3065e3c6 [MERGE] forward port of branch saas-3 up to b7f9f4a 2015-06-18 19:33:19 +02:00
Christophe Simonis b7f9f4ade0 [MERGE] forward port of branch 7.0 up to e8e3f75 2015-06-18 19:29:47 +02:00
Nicolas Martinelli fa57ce878e [FIX] account: wrong domain for UoM
This allows to reset correctly the domain of UoM if the product is not set.
Without this patch, the domain used is the domain of the previous product in
the list.

opw-642074
2015-06-17 11:53:58 +02:00
Christophe Simonis 5e7f143c21 [MERGE] forward port of branch saas-3 up to ed76b2a 2015-06-11 13:00:49 +02:00
Christophe Simonis ed76b2a782 [MERGE] forward port of branch 7.0 up to e470385 2015-06-11 12:46:06 +02:00
Nicolas Lempereur 69f87cd34c [FIX] account: get uom at account invoice creation
For commit c63230d0d if there is no uom, it should not fail.

closes #6920
2015-06-01 16:03:46 +02:00
Nicolas Lempereur c63230d0d0 [FIX] account: force uom from product category
When we change a product line of an account invoice, a current unit with
a invalid unit category was not dropped which should be since:

- it is different from a sale.order,,
- there is a domain on the unit of measure only allowing units from the product's unit category.

This fixes drop the current unit of mesure in this case.

opw-640985
2015-06-01 15:27:58 +02:00
Stéphane Bidoul d83befdb0f [FIX] account: tax amount for include_base_amount
The tax_amount on account.move.line generated from the validation of an invoice
did not include the taxes with 'include in base amount' enabled.
Instead of using the line total, use the price_unit of the tax which is
correctly computed through compute_all method.
Fixes #5939
2015-05-12 16:07:24 +02:00
Nicolas Martinelli 4392289745 [FIX] account_invoice: residual of invoices in foreign currencies
If a line of the invoice move was in a foreign currency
but its residual amount in this foreign currency was 0,
the `amount_residual` (in company currency) was used,
instead of the `amount_residual_currency`, which
is the residual amount in this foreign currency.

This was due to the fall back with the `and / or` statement.
Using `if / else` instead solves the issue.

This could lead to issues when the residual amount
in the foreign currency was 0, but the residual amount
in the company currency was 0.01, due to the exchange rate
loss.
2015-05-06 18:29:47 +02:00
Goffin Simon eb0a309522 [FIX] account: lang used for invoice taxes
The lang used for invoice taxes must be the lang of the partner.

opw:631461
2015-04-13 17:12:45 +02:00
rmu-odoo 223c92f3c0 [FIX] account: prioritize supplier number over reference on invoice
When generating the accounting entries, to compute the name, the invoice
reference (e.g. origin purchase order name) was first used before the supplier
invoice number. To facilate reconciliation of bank statements, the supplier
invoice number makes more sense.
Fixes #3839, opw 618765
2015-04-09 11:33:44 +02:00
Christophe Simonis 8ad11055bb [MERGE] forward port of branch saas-3 up to 12f600c 2015-04-01 19:13:25 +02:00
Christophe Simonis 12f600cec9 [MERGE] forward port of branch 7.0 up to 35077af 2015-04-01 19:07:59 +02:00
Rifakathusen Haradwala 3cae2c5155 [FIX] account: wrong tax amount for manual tax line
On an invoice, tax lines are generated in tax_line field. When modifying
manually the tax amount, the recomputed tax_amount field was incorrect in
multicurrency environment, leading to an entry with different tax amount and
debit value.
opw 611474
2015-03-30 16:43:08 +02:00
nachosalvador 75f0c7df4d [FIX] account: fetch name from first line only
invoice_line is a one2many, causes expected singleton error if the invoice has
more than one line.
2015-03-30 10:45:27 +02:00
Nicolas Martinelli f7de3f0603 [FIX] account: product variants prices in invoices
when a customer invoice is created directly,
if a product variant is selected,
it now computes the price from the product variant and
not from the product template.

opw: 629285
2015-03-10 14:56:25 +01:00
Denis Michiels 4bf5ce94d2 [FIX] account_invoice : origin field for refund invoice
When creating a Refund invoice, the field "origin" is fill with
the number of the invoice to refund

fix #5233
opw 627828
2015-02-23 13:38:44 +01:00
Denis Michiels 8da53f9dec [FIX] account: taxes translated in partner language
Regression introduced during cbe2dbb672
Fixes #5132
opw-627826
2015-02-16 10:20:51 +01:00
Martin Trigaux 3695886531 [FIX] account: avoid losing product on invoice
Add restriction on product_id field to prevent the suppression of the product
if already present in an invoice.
This is to avoid the suppression of a used product variant when modifying
the list of attributes.#
Due to the constrain, the variant will be disabled instead of deleted.
Fixes #4129

Add warning message on the product form to warn users about the potential impact
of modifying variants.
2014-12-10 11:49:19 +01:00
Christophe Simonis d37dd37059 [MERGE] forward port of branch saas-3 up to e1e7dc0 2014-12-01 15:42:51 +01:00
Denis Ledoux 64fd5288c8 [FIX] account: There is no sale_refund nor purchase_refund analytic journal
During rev. cbe2dbb, type2journal was refactored, and set as a global variable in the top of the file, as it was use everywhere accross the file.
But, in this specific method _get_journal_analytic, this type2journal dict wasn't the same as everywhere else, as you can see at rev. d2ff95f for example. We must therefore set a specific type2journal dict for this specific method.
2014-12-01 15:31:12 +01:00
Denis Ledoux 02f4f9a572 [MERGE] forward port of branch 7.0 up to e2dd18f 2014-11-26 12:35:36 +01:00
Denis Ledoux 4ca389a1a6 [FIX] account: prevent invoice line duplication on partner duplication
If a company contact (a partner with a company set as parent) had invoices, and the company of this contact was duplicated, all the invoices lines were duplicated,  on the original invoice moreover (new lines were added on existing invoices)
2014-11-25 18:23:45 +01:00
Arthur Maniet d50d89566c [FIX] account: correctly compute residual amount of partially reconciled multi-term invoices.
Fixes #1213
2014-11-04 14:46:09 +01:00
Arthur Maniet 4a8b8df813 [FIX] account: recompute invoice residual amount when one of its move lines is totally reconciled
Fixes #3395
2014-11-04 14:45:09 +01:00
Denis Ledoux f7723037d6 [MERGE] forward port of branch saas-3 up to 8c4a7cb 2014-11-04 12:30:01 +01:00
Denis Ledoux 8c4a7cb371 [MERGE] forward port of branch 7.0 up to 5035c76 2014-11-04 12:19:58 +01:00
Stéphane Bidoul 18b7b28bc1 [FIX] account: backport of 12a39db
[FIX] account: Preserve analytic account on tax lines which are on same general account as invoice line

After careful analysis, I'm now convinced it is a good thing to preserve
the analytic account on taxes line which have the same general account
as the invoice line.

This is the best default case and will save time for users,
while leaving the flexibility to adapt the analytic account on
taxes manually.
2014-11-04 11:29:00 +01:00
Stéphane Bidoul ab797f0cd8 [FIX] account: backport of 3470643
[FIX] account: Error when manually adding analytic account in the generated tax lines on an invoice

fixes #374
fixes https://bugs.launchpad.net/ocb-addons/+bug/1084822

The fix considers invoice tax lines with different analytic account
are equivalent for the purpose of checking if the list of tax line
is complete.

Caveat, this changes the structure of keys in the dictionary
returned by account.invoice.tax's compute method, I suppose this
is ok for the master branch.
2014-11-04 11:28:10 +01:00
Christophe Simonis 8e637bac92 [MERGE] forward port of branch saas-3 up to 21b1203 2014-10-29 19:33:02 +01:00
Denis Ledoux a6024a6376 [MERGE] forward port of branch 7.0 up to 00ec786 2014-10-28 13:40:17 +01:00
Denis Ledoux 96bcaadd46 [FIX] account: limit search for fields_view_get to one result
+ use ir.model.data get_object_reference method for better performance (cached result)

opw-616616
2014-10-27 13:24:47 +01:00
Christophe Simonis 2e3f59181d [MERGE] forward port of branch saas-3 up to db75994 2014-10-14 15:13:14 +02:00
Denis Ledoux d38adf3d92 [FIX] account_invoice: using has_group to determine if user has group group_supplier_inv_check_total
has_group do not care about the fact res.groups is access restricted
2014-10-09 18:57:37 +02:00
Denis Ledoux b13898c058 [MERGE] forward port of branch 7.0 up to 03df412f 2014-10-07 17:34:42 +02:00
Denis Ledoux 03df412faf [FIX] account: precision_get returns a number of digits
In other words, it returnes a precision digits, not a precision rounding
2014-10-07 17:26:49 +02:00
Denis Ledoux 39bb45a8ea [MERGE] forward port of branch 7.0 up to 333852e 2014-09-26 21:32:40 +02:00
Martin Trigaux ceff8ef899 [IMP] account: use float_compare for taxes
Avoiding some python float representation errors
2014-09-26 16:57:28 +02:00
Commandant Custo 7c70660404 [FIX] account: typo in conversion to new API 2014-09-23 14:26:47 +02:00
Arthur Maniet 9f481d6c64 [FIX] account: account_invoice's onchange_partner_id uses the first partner bank account if several are defined. Merge of #2280 2014-09-16 13:37:51 +02:00