Commit Graph

1319 Commits

Author SHA1 Message Date
Thibault Francois 1644b92fd8 [FIX] account format error message correctly
Cherry-Pick of a04c1a2ac5244fe2fd3098fc22c59d336e352981
2017-07-28 16:15:35 +02:00
Alexis de Lattre b5a8e5c864
[FIX] account: verify the partners are the same
Re-enable the constraint when reconciling entries belonging to different
partners.
The constrain was not triggerd because of the triggers on line_id.
In old API it was triggered only when explicitely writing on that field.

Convert to new API instead.

Fixes #17292
Closes #17600
2017-06-22 15:19:05 +02:00
Stefan Rijnhart (Opener) f6986c8cff [FIX] account: fix copy() of accounts having children
Don't pass default code to child accounts to avoid raising wrongly the constraint: duplicate key value violates unique constraint "account_account_code_company_uniq"  

Courtesy of Stefan Rijnhart (Opener). Was PR #16804
2017-05-30 14:12:47 +02:00
chafique-delli 352ab7c51b
[FIX] account: add missing context
Closes #10691
2016-12-19 18:31:00 +01:00
Stefan Rijnhart 4f6e4bb28e
[FIX] account: use code from defaults dict if present
Do not force a ugly '... (copy)' code if provides one.
Closes #11260
2016-12-14 15:08:13 +01:00
Alexandre Fayolle 65c685ad24 [FIX] context mutations (#10368)
when extending these methods with the new api, the context is a frozendict
so we need to copy before mutating.

this patch was made by searching for key addition to context and calls to the
update() method on the 8.0 addons, and checking if a copy was made before in
the method.
2016-10-12 12:30:42 +02:00
Nicolas Seinlet f207ef5fae [IMP] account: improve reconciliation speed
- Only invalidate cache for fields and records we modify
 - Rewrite query to be more efficient
 - Avoid o2m commands to be more efficient; write directly on reverse m2o
2016-05-12 11:41:13 +02:00
Nicolas Martinelli d6c88b8809 [FIX] account: filter out special periods
Commit 7b7f3fa filters out the special periods. However, the filtering
should be done only for the display in the form view, nto for the
reporting which is actually correct.

opw-672531
2016-03-22 13:07:30 +01:00
Nicolas Martinelli 7b7f3fa76a [FIX] account: filter out special periods
When computing the balance, debit and/or credit, the opening period must
be filtered out. Otherwise, the invoices which are still opened at the
time of the period closing will be counted twice.

opw-670584
2016-03-16 09:59:13 +01:00
Raphael Collet 5763c32a6d [FIX] addons: fix usage of decorators `api.v7`/`api.v8`
Specifically, when one API implementation calls the other one, it has to call
the method *from the same class*.  Otherwise, overriding the method may result
in an infinite recursion.  Consider:

    class A(Model):
        _name = 'stuff'

        @api.v8
        def foo(self):
            return 42

        @api.v7
        def foo(self, cr, uid, context=None):
            return self.browse(cr, uid, [], context).foo()

    class B(Model):
        _inherit = 'stuff'

        def foo(self, cr, uid, context=None):
            return super(B, self).foo(cr, uid, context=context) + 1

and now call: `env['stuff'].foo()`.  This invokes `B.foo` (new-API), which
calls `B.foo` (old-API), which calls `A.foo` (old-API), which calls `B.foo`
(new-API) instead of `A.foo`!

This issue would not be present if old-API `A.foo` was defined as:

        @api.v7
        def foo(self, cr, uid, context=None):
            return A.foo(self.browse(cr, uid, [], context))
2016-02-09 10:01:43 +01:00
Luc De Meyer b493faf595 [FIX] account: pass context as kwargs
context -> context=context in writes within validate.
This is required for super().write with new api.

Closes #10645
2016-01-28 17:30:41 +05:30
luc-demeyer 66ce0ac970 [FIX] account: name_search for multilang CoA
The `account.account` `name` can be translated
as soon as `l10n_multilang` is installed.

Not passing the context in the calls to
the `search` method prevented to search
on the translations of this name.

Closes #4511
2015-10-02 11:00:04 +02:00
Goffin Simon 503820acb6 [FIX] account, purchase, sale: included taxes
-account:_fix_tax_included_price
If a fiscal position mapped an included tax on a SO or on a PO line
then the price unit of the product must be recomputed.

-purchase: onchange_product_id test
Test that when an included tax is mapped by a fiscal position, the included tax must be
subtracted to the price of the product.

-sale:product_id_change test
Test that when an included tax is mapped by a fiscal position, the included tax must be
subtracted to the price of the product.

opw:647321
2015-08-26 09:02:39 +02:00
Nicolas Martinelli 95f49eadc1 [FIX] account: consistency on the allowed precision
This fixes 2 issues.
First, it keeps consistent the precision required for posted entries and the
precision for the balance assertion. This could be an issue if the account
precision is larger than 4.
Then, it makes sure to round the amount with the appropriate precision to avoid
numerical errors. For example 1.2344 - 1.2345 = -9.999999999998899e-05, which
is indeed smaller than the required precision 10 ** -4.

A minimum precision of 10 ** -5 is kept for historical reason.

Fixes #7276
opw-643305
2015-06-30 12:46:30 +02:00
Olivier Dony 8d745f9f50 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 15:26:35 +02:00
Denis Ledoux 41f4b11ef4 [MERGE] forward port of branch saas-3 up to e552e09 2015-04-30 15:45:03 +02:00
Denis Ledoux 2c3c2b57db [MERGE] forward port of branch 7.0 up to f2f4391 2015-04-30 10:50:51 +02:00
Mohammad Alhashash a6a3db3188 [FIX] account: custom '_where_calc' method instead of 'search'
The domain on account.account was preprocessed in search method but it had no
effect on read_group. This lead to inconsistency or errors when using 'goup by'
filter.

Move domain processing in '_where_calc' method instead as this is used by both
'search' and 'read_group'.
2015-04-29 11:17:47 +02:00
Goffin Simon 37bf219643 [FIX] account: Display Taxes
The function _unite_compute and _unit_compute_inv did not give the same display result.
Regardless the way the tax is computed, the display must be the same. The display must
only shows the name of the tax.

opw:633828
2015-04-28 11:25:44 +02:00
Denis Ledoux cf4d14ce39 [MERGE] forward port of branch saas-3 up to 09b277c 2015-04-27 14:02:52 +02:00
Denis Ledoux d6ae7fb7db [MERGE] forward port of branch 7.0 up to 3e7d3c7 2015-04-27 12:19:43 +02:00
Denis Ledoux 3e7d3c7ee4 [FIX] account: tax_amount can be null in database
The `tax_amount` of move lines is by default set to `0.0`.
Nevertheless, this default value is set by Odoo,
not by postgresql.

This is therefore likely that the `tax_amount` is set as
null instead of 0.0, in database.

Therefore, when getting this value directly with a SQL
request, this is possible that `null` will be returned.

Therefore, in this specific case, `res.get(record.id, 0.0`
could return `False`, if the sum of `tax_amount` is `null`,
and try to multiply a boolean with an integer is not possible:
`_rec_get(rec) * rec.sign`

opw-633903
2015-04-27 12:01:21 +02:00
Goffin Simon 6f679678f6 [FIX] account: duplicate tax
the duplication of a tax must duplicate the child_ids.

opw:630510
2015-04-21 10:09:56 +02:00
Rifakat Haradwala a08b9c2c41 [FIX] account: forbid creating entries on closed period
Prevent creating/modifying accounting entries made on close periods.
The period_id and journal_id field on a account.move.line is a related so was
silently (without write call) updated so did not triggered the call to
_update_journal_check while modiying the linked account.move
Force the check in the validation of the move. As the move can not be balanced
without going through this method, this will prevent posted entries in closed
accounting period.
Fixes #1633, opw 615886
2015-02-04 15:28:55 +01:00
Denis Ledoux d9e48bae42 [MERGE] forward port of branch saas-3 up to 7ab4137 2014-11-14 16:58:24 +01:00
Denis Ledoux 7ab413724a [MERGE] forward port of branch 7.0 up to da15c9d 2014-11-14 15:59:33 +01:00
qdp-odoo 3540484138 [FIX] account: allow to use quantity in taxes computated with python code 2014-11-14 15:45:13 +01:00
Samus CTO 1a826e07fe [IMP] Speedup test account_assert_test.xml in account 2014-11-13 17:00:42 +01:00
qdp-odoo 19da7b708c [FIX] account: fixed broken constraint (due to the passage to the new API) to ensure the same partner is present on journal items we try to reconcile partially. Fixes #2527 2014-10-01 16:05:53 +02:00
Denis Ledoux 96dd8bf507 [FIX] account: default product taxes on product.template
As product.template is now most commonly used than product.product
2014-09-29 17:56:39 +02:00
qdp-odoo f4e350ca36 [FIX] account: several fixes on the new bank statement reconciliation widget 2014-09-04 11:32:16 +02:00
Christophe Simonis 5dff035878 [MERGE] forward port of branch saas-5 up to 39bee35 2014-08-20 20:33:17 +02:00
Christophe Simonis c3131317d7 [MERGE] forward port of branch saas-4 up to ddef2dd 2014-08-20 17:57:22 +02:00
Christophe Simonis ddef2dd10a [MERGE] forward port of branch saas-3 up to 8f13e83 2014-08-20 17:51:20 +02:00
Christophe Simonis 8f13e8320e [MERGE] forward port of branch 7.0 up to d0a0b7d 2014-08-20 17:45:05 +02:00
Olivier Dony 971ffa3db1 [FIX] account: reconcile: no useless revalidation
Avoid revalidating the complete account moves
that contain the lines being reconciled.
The reconciliation does not change the validity
of those moves anyway.
This represents a very important speed up of
reconciliation when moves with several hundred
lines are involved.
2014-08-14 16:51:37 +02:00
rlu-odoo 8b67a7202d [REF] OpenERP --> Odoo in various UI texts
Rebranding has been done in:
- data/demo files
- html templates
- help notices
- comments
- logger messages
- and other various messages

(Commit taken from odoo-dev:8.0-improve-openerp-odoo-rlu at rev 7deaa08)

Closes #1260
2014-07-18 13:45:41 +02:00
Stéphane Bidoul 5df99ce622 [FIX] account: add `sequence` on account.tax.code.template
Relying on the ordering by tax code is not sufficient,
as some tax declarations such as the Luxemburg one,
show tax case codes not ordered numerically

Original fix courtesy of Stefan Rijnhart (Therp)

Fixes: lp:1168948
Rebase of: PR #759
2014-07-14 11:33:05 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
ssh-odoo 6cc4bd4312 [Imp]:Improve configuration warning msg
[imp]:remove space

[rem]:remove code

[imp]:remove changes

[imp]:remove changes

[rem]:remove unused changes
2014-07-03 16:11:15 +05:30
qdp-odoo f2a2a8cca4 [FIX] account: default value for with_last_closing_balance field set to True 2014-07-01 14:46:38 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary `size` parameters on char fields 2014-06-25 17:13:43 +02:00
Olivier Dony f15cbd6520 [MERGE] Forward-port saas-4 bugfixes up to ad4c6ca 2014-06-12 18:54:36 +02:00
Olivier Dony ad4c6caecf [MERGE] Forward-port of saas-3 bugfixes up to 9f0ecb3 2014-06-12 13:52:35 +02:00
Olivier Dony 9f0ecb3572 [MERGE] Forward-port of 7.0 bugfixes up to 4d3a5df 2014-06-12 13:49:32 +02:00
Jeremy Kersten 5a95d00f33 [FIX] Import - Use the right comparator to allow import with accounts_ids 2014-06-12 13:29:40 +02:00
Martin Trigaux b38a129d71 [FIX] account: move translatable tag
The field note on account.fiscal.position and account.fiscal.position.template should not be translatable in classic modules.
The l10n_multilang module is intendend to make chart of accounts multilang and is the place to set translate=True
2014-06-11 14:53:59 +02:00
qdp-odoo e3491ccb71 [IMP] account: bank statement reconciliation widget (part 2) 2014-05-30 18:47:50 +02:00
Denis Ledoux cab190b136 [MERGE] Forward-port of latest saas-3 bugfixes, up to rev. 9460 revid:dle@openerp.com-20140519103942-do7uem4in0jfqzo2 2014-05-19 12:46:33 +02:00
Denis Ledoux 3c033c76d4 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 10050 revid:dle@openerp.com-20140516110134-oadkw3xt5bhky781 2014-05-16 14:54:00 +02:00