Commit Graph
67 Commits
Author SHA1 Message Date
Stéphane Bidoul 9d2b18f047 [FIX] core: don't fail on bad version for uninstallable addons
When an addon has an invalid version but is not installable,
there is no need to error out. This situation typically happens
when unmigrated modules are present in the addons path.

closes odoo/odoo#157657

Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
2024-03-19 09:24:19 +00:00
Stéphane Bidoul 8e040df274 [IMP] core: add odoo.__main__
This allows launching Odoo with "python -m odoo".

This manner of launching python applications is now widespread.
In particular it makes it easier to configure an IDE debugger to run with the correct python version.

closes odoo/odoo#81864

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2022-10-19 15:12:44 +02:00
Stéphane Bidoul 9224313e34 [IMP] account: search on parent_state instead of move_id.state
By searching on account.move.line parent_state instead
of move_id.state, we avoid a join in many circumstances
and allow the database to benefit on an index on
company_id+parent_state to optimize several
queries, such as the default filter on the Journal Items
menu which shows posted items.

closes odoo/odoo#82504

X-original-commit: ef61db1cf8ebf1ab11e5dfdd439256d0607edba8
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-01-11 06:48:27 +00:00
Stéphane Bidoul 35f8e21c65 [IMP] account: avoid join when filtering on journal
account.move.line has a journal_id field that is related on move_id.journal_id.
By searching on journal_id we avoid a useless join,
offering more room for database query optimizations.

closes odoo/odoo#81856

X-original-commit: 2741f245f8a47e971309e97128662f1863329e45
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-01-10 14:49:49 +00:00
Stéphane Bidoul a79426c3e3 account: search on parent_state instead of move_id.state
By searching on account.move.line parent_state instead
of move_id.state, we avoid a join in many circumstances
and allow the database to benefit on an index on
company_id+parent_state to optimize several
queries, such as the default filter on the Journal Items
menu which shows posted items.

closes odoo/odoo#80815

X-original-commit: c2a72c268e6a28d7448b6dbf96fed4e36d24b3fe
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2021-12-06 09:06:06 +00:00
Stéphane Bidoul cf7a21d733 [FIX] core: install new dependencies of module to upgrade
When a custom module is in 'to upgrade' state,
and the code has a dependency that is not yet
installed, Odoo refuses to upgrade it, and
says the new dependency is unmet.

This commit fixes this by also calling button_upgrade() in this situation,
and not only for modules in 'installed' state.

This situation arises in a version migration scenario. Custom modules are
in 'to upgrade' state after migration.
If one of these custom modules has a new dependency
after migration, it refuses to upgrade.

closes odoo/odoo#72942

X-original-commit: d5ffe0159ada953985a23c29e36763599bd10ed9
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2021-06-29 13:46:07 +00:00
Stéphane Bidoul 9a131b2f78 [FIX] base: do not check dependencies of uninstallable addons
When an installed module is not installable, we don't want
to check its dependencies because they may not be available.
Erroring out on such dependencies is not needed because
the module will not be loaded anyway. On the contrary, such
errors prevent starting a database which would otherwise
function normally.

Such errors occur when doing incremental migrations where
it happen that addons are installed (from the previous version)
but not migrated yet and therefore not installable.
When we migrate lower level dependencies Odoo marks
higher level addons as "to upgrade" even if they are not installable.
That is usually harmless, except when such addons have
dependencies that are themselve not available.
This PR fixes that.

closes odoo/odoo#73206

X-original-commit: a11e8a32883b0d0deaeb2497daa585eb3d3c686e
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2021-07-05 08:45:13 +00:00
Stéphane Bidoul 13b40bff2c [FIX] base: allow using another postgres schema than public
Before 1721ec1363 and fdc4ef97c9, Odoo did work fine when the
user had another default schema than 'public'.
This commit restores this behaviour by searching
for existing objects in the user's current schema,
which is the first in the schema search path and
the one used when no schema is specified when
creating objects.

closes odoo/odoo#68144

X-original-commit: 223781b34afacd1c0c5674d395cece6d472b048c
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-03-19 12:42:16 +00:00
Stéphane Bidoul (ACSONE) c8c8413e3e [IMP] mail: enforce kw args for message_{post/notify/log}
Since there are message_post overrides using the form `def message_post(self,
**kwargs)` in some modules, this method is intended to be invoked with keyword
arguments only.

This commit enforces this behavior. Calls such as `message_post("body")` will
fail regardless of which addon is installed, forcing users to use
`message_post(body="body")`.

It also fixes a message_post override in hr, and applies the same
mechanism to message_notify, and _message_log.

closes odoo/odoo#33306

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-02 15:42:04 +00:00
Stéphane Bidoul (ACSONE) 795c7b0a94 [IMP] core: improve python external dependencies check
Use pkg_resources.get_distribution() to check if python external
dependencies are installed, instead of trying an import.
The import test is preserved as a backwards compatibility measure.

This better expresses which python distribution needs to be installed
from PyPI and allows declaring a minimum supported version using PEP 440
version specifiers.

Closes #25541

closes odoo/odoo#25549

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-05 17:25:59 +00:00
Stéphane Bidoul (ACSONE) 060e35f62a [FIX] account: allow cancelling payment whith draft move
Payment journals have an option to keep moves unposted until bank statement
reconciliation.
When cancelling such payments, it is not necessary to attempt canceling the move
if it is unposted.
This patch allows cancelling such payments without needing to configure the
journal as cancellable while the move is still draft.

To reproduce:
1. check "Post at bank reconciliation" on a bank journal
2. do "Register payment" with that journal on a invoice
3. open the generated payment
4. click cancel => error "You cannot modify a posted entry of this journal..."

closes odoo/odoo#33312

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-05-27 14:30:46 +00:00
Stéphane Bidoul (ACSONE) e6060dc7be [I18N] l10n_fr_fec: update fr.po
The file no longer matched the linked .pot file

closes odoo/odoo#29328
2019-01-02 15:15:55 +00:00
Stéphane Bidoul (ACSONE) 27f03ab023 [FIX] account: view partially reconciled entries visibilitly
The visibility condition of the Matching group on account move line
was not compatible with the visibility condition of the
"View partially reconciled" button. So the group being hidden was
hiding the button that should overwise have been visible.

closes #32043
closes #32216

opw:1961210

closes odoo/odoo#32371

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-03 11:09:17 +00:00
Stéphane Bidoul (ACSONE) 189e0088e0 [FIX] account: preserve deactivated taxes on move lines
Similar to cd3f52ba10 that was made for invoices.

Was PR #25655. Courtesy of Stéphane Bidoul (ACSONE)
2018-07-11 16:56:59 +02:00
Stephane Bidoul b9488caa64 [ADD] l10n_lu: translate chart of accounts
In English, French and German.

Closes #21651
2018-03-16 15:20:16 +01:00
Stéphane Bidoul (ACSONE) 854943379b [FIX] hr_expense: fix Not Refused filter
"cancel" is not a valid hr.expense state
This filter should be the opposite of the one above.

Closes #18823
2018-03-16 13:23:54 +01:00
Stephane Bidoul 3bf9cf4f36 [FIX] l10n_multilang: correctly set src
While it is the name of the record that is set most of the time, it can also
be different value (like tax description)

Closes #21651
2018-03-15 16:40:53 +01:00
Stéphane Bidoul (ACSONE) bb10cd50c2 [FIX] web: issue with id field in x2m form
When the 'id' field is present in a x2m form, the x2m actions generated
on create of the parent object are incorrect.
2018-01-03 13:22:09 +01:00
Stéphane Bidoul (ACSONE) a8e444bea8 [FIX] l10n_lu: bad line breaks in CSV data
This was causing the creation of weird records when installing this module
2017-12-19 16:48:35 +01:00
Stéphane Bidoul (ACSONE) 34ed42f16d [FIX] hr_expense: unbreak consistency check
Purpose
=======

Unbreak consistency check:

- on creation (check not done)
- when applied to a record set of several sheets belonging to different employees (reporting spurious errors)

Specification
=============

- self.something() in a api.model method does not make sense, so I replaced it with a call on the newly created sheet.
- Iterate on sheets instead of mapping all the lines
2017-12-18 12:37:28 +01:00
Stéphane Bidoul (ACSONE) 5377f7b85c [FIX] hr_expense: Make _check_employee dependent on employee_id
Purpose
=======

Employee must match on sheet and lines

Since the employee_id field of hr.expense.sheet is modifiable in submit state, there is a possibility to modify a sheet in such a way that the employee does not match on the expense sheet and expense lines. This commit fixes this.
2017-12-18 12:32:17 +01:00
Stéphane Bidoul (ACSONE) 8bf06adc8d [FIX] namespace packages: move from pkg_resources-style to pkg_util
Deprecates the previous pkg_resources-style packages. Our use was
not entirely spec compliant, and it broke with setuptools 31.
More information in https://github.com/odoo/odoo/pull/15718

Instead, use the pkgutil-style namespace packages.
This is spec compliant as long as all other distributions providing
odoo.addons use PEP 420 namespace packages (i.e. no __init__.py).
So this mechanism fully works on Python 3 only, but does not break
anything on Python 2.

See also:
https://packaging.python.org/guides/packaging-namespace-packages/#pkgutil-style-namespace-packages

Closes #19517
Fixes #15718
2017-09-18 16:05:31 +02:00
Stéphane Bidoul (ACSONE) e6ae9a21a2 [FIX] account: Display the correct journal tree view by default.
Closes #17274

Without this, the Configuration > Accounting > Journals shows
the Bank Journals view. And the type column is missing.

This align with what is done for the form view.
2017-05-30 10:16:17 +02:00
Stéphane Bidoul (ACSONE) 6f1c291982 [FIX] auth_ldap: allow non-ascii ldap base
For installations with accents in the name

Closes #15597
2017-02-24 15:18:51 +01:00
Stéphane Bidoul 7e58821a9f [REF] account: prepare method for invoice tax lines
This is needed for example, to enhance the analytic dimension of these
lines.

Closes #12739
opw-691337
2016-10-17 15:21:47 +02:00
=?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= 389c2ba97b [REF] packaging: make odoo a namespaced package
by auto-extending addons path with odoo.addons.__path__.

This patch also introduce
  * an explicit declaration of odoo.addons as a namespace package
    This is necessary because the standard way of declaring namespace
    packages in setup.py does not work as long as odoo/__init__.py
    contains code.
  * a more reliable way to find odoo root path.
2016-09-30 12:05:49 +02:00
Stéphane Bidoul (ACSONE) dbd4114d38 [FIX] l10n_lu: fix reconcile flag in accounts template csv
Changes f -> FALSE and t -> TRUE, otherwise when installing the l10n_lu
COA, the reconcile flag is wrong.

Closes #13282
opw-688957
2016-09-20 17:46:13 +02:00
Stéphane Bidoul (ACSONE) 862e4c42ba [CLA] Add Thomas Binsfeld in ACSONE CCLA
Closes #12810
2016-07-22 10:51:55 +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
Stéphane Bidoul (ACSONE) ee3666237a [CLA] add Denis Roussel in Acsone CCLA
Closes #12570
2016-06-24 14:31:00 +02:00
Stéphane Bidoul 4162b8f5fa [FIX] account: fiscal position in multi-company environments
Properties depends on with which companies the records
are browsed.

When retrieving the fiscal position as sudo,
the company must therefore be enforced within the context,
to make sure to get the properties from the right
company.

This method can totally be accessed as sudo,
within the crons for instance.

Before this revision, the recurring invoices cron
could retrieve properties from the wrong company,
and therefore retrieve the fiscal position of another
company.

Closes #11039
2016-02-23 17:25:42 +01:00
Stéphane Bidoul e11490c3a1 [FIX] account: Analytic account domain in reconcile with writeoff wizard
The domain for the analytic account in the `reconcile with writeoff` wizard
should be based on the `type` field, which must be `view`,
not on the `parent_id` field, as it's done everywhere else
(e.g. in the supplier invoice form).

`[('parent_id', '!=', False)]`
and
`[('type', '!=', 'view')]`
is almost the same, but the second domain is more appropriate.

Closes #4562
2015-09-30 16:22:05 +02:00
Stéphane Bidoul 8d58d985dd [FIX] http: no auto-load for modules not installable
Closes #8289
2015-09-09 13:56:55 +02:00
Stéphane Bidoul 63aed83637 [FIX] l10n_be: missing mappings of accounts to financial report
Closes #1250
2015-06-29 10:11:02 +02:00
Stéphane Bidoul (ACSONE) 4213eebe2e [FIX] point_of_sale: correctly split workds in product search
The JS replace method, unlike python's, only replaces the first occurence
unless a search pattern is provided.

Closes #6302
2015-06-26 08:51:25 +02:00
Stéphane Bidoul da9d1a8c45 [FIX] account_budget: support view and consolidation children in budget positions
In account_budget module,
when creating a budget position,
the user can select view accounts and also accounts with consolidation children,
in addition to normal accounts.

However, when viewing budgets with positions containing only view accounts,
the "practical amount" field was always zero.

Since these type of accounts are accepted as budget positions,
the system should take into account children and consolidation children
when computing the practical amount.

Fixes #372
Closes #1247
2015-06-24 18:21:11 +02:00
Stéphane Bidoul 1d5651de5d [IMP] l10n_lu: update for VAT 2015, misc fixes
- remove 2011 tax data
- remove unneeded tax account for 0% taxes
- TVA en amont moved under 421611 instead of 422611
- Fix issues with IB-PA, AP-PA, IP-PA and all taxes with children
- improve structure for tax codes
- fix account type (other -> view)
- add fiscal position mappings
- credit part of IC/EC taxes goes into account 461 instead of 421
- add missing template account for TVA en amont extracommunautaire
- fix a long standing issue with the reconcile flag on accounts
- use TRUE/FALSE instead of t/f in the csv
- added source XLS file with conversion script

Closes #5870
2015-06-22 17:57:23 +02:00
Stéphane Bidoul d291aba4b5 [FIX] server: graceful shutdown must send SIGINT instead of SIGTERM to workers
Workers do not specifically handle SIGTERM so it can be used to
force quit them, but the graceful shutdown is triggered by SIGINT.

Closes #6738
2015-06-11 12:00:57 +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
Stéphane Bidoul 9d167ea7b3 [CLA] Acsone (fix emails)
Closes #5217 (again)
2015-02-11 12:15:41 +01:00
Stéphane Bidoul 71e3b2d624 [CLA] ACSONE signature of Corporate CLA 1.0
Closes #5217
2015-02-11 11:06:16 +01:00
Stéphane Bidoul 34fe1d211d [IMP] add support for directory templates in scaffold
closes #4767
2015-01-19 10:35:41 +01:00
Stéphane Bidoul c68ecbe093 [FIX] account: do not validate move when novalidate is in context
The key 'novalidate' is added in the context when an operation not impacting
the validation of a move is made. The validation recreates analytic lines
which decrease the performances.

In case of registrating a payment, the skipped validation are the one from
the reconcile method (reconciliation does not change the validity)
Fixes #3787, opw 618529
2014-12-08 16:47:47 +01:00
Stéphane Bidoul d247f6c9e2 [IMP] account_payment: remove dead voucher code and extension hook
Since bank statement do not use vouchers anymore in 8.0,
it's not necessary to create the voucher anymore.

Additionally, I add an extension point to let modules adapt
the statement line.
2014-11-18 13:32:47 +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
Stéphane Bidoul a1fa667be5 [IMP] point_of_sale: distinguish discounted lines
After closing a POS session, the pos order lines are grouped by product.
Instead, distinguish products with a different discount notice to have different lines for such products in the generated account.move for better traceability.
2014-11-04 10:07:42 +01:00
Stéphane Bidoul 24ec228acc [FIX] avoid leaving dangling account moves when deleting a bank statement
Fixes #3292
2014-10-27 10:58:11 +01:00
Stéphane Bidoul ae742db21d [IMP] broaden scope of search of bank statement reconciliation candidates
Looking for accounts with reconcile=True is enough.
Restricting on payable/receivable account types narrows the search
to much and makes it difficult to implement transfer account holding
the payment while they are in transit at the bank.
2014-09-17 14:24:24 +02:00
Stéphane Bidoul (ACSONE) 518649c371 [FIX] l10n_be: spelling error in financial reports 2014-08-06 16:59:34 +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
Stéphane Bidoul 12a39db8c3 [FIX] 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-07-11 22:57:58 +02:00
Stéphane Bidoul 34706433e7 [FIX] 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-07-11 22:57:57 +02:00
Stéphane Bidoul 50b48e0d13 [FIX] l10n_lu: wrong mapping of accounts to P&L financial report
Account 655 and its child 6554 were both mapped.
Fixed by unmapping 655 and mapping all its direct children.

(Manual rebase of PR #733)
2014-07-11 15:50:10 +02:00
Stéphane Bidoul be82c99b23 [FIX] l10n_lu: taxes (amont/aval)
The accounts "TVA en amont" were not used by the l10n_lu chart of accounts.

Instead the accounts "TVA en aval" were used for all taxes both sale and purchase taxes.

(Manual rebase of PR #735)
2014-07-11 15:47:45 +02:00
Stéphane Bidoul 709b6d9ba8 l10n_lu account chart: align account names with latest eCDF field list
bzr revid: stephane.bidoul@acsone.eu-20130605075244-x7hhf9kl1nr1rb42
2013-06-05 09:52:44 +02:00
Stéphane Bidoul f2ad29fe1d l10n_lu account chart: add missing mappings between account chart and financial reports
Accounts 756, 758 and 759 should be the only one not mapped as 
the mapping is ambiguous, and child accounts should me mapped individually.

bzr revid: stephane.bidoul@acsone.eu-20130605074300-gyiwqfb7qa7wwkbo
2013-06-05 09:43:00 +02:00
Stéphane Bidoul ef8b1bbde7 [FIX] improve l10n_lu financial report labels
bzr revid: stephane.bidoul@acsone.eu-20130220114107-uxxubknx3v6wg7qq
2013-02-20 12:41:07 +01:00
Stéphane Bidoul 2aee5380eb [IMP] ref and browse_ref helpers on openerp.tests.common.BaseCase
bzr revid: stephane.bidoul@acsone.eu-20121031103027-2sozmbi3z7bkr22q
2012-10-31 11:30:27 +01:00
Stéphane Bidoul ad811bf48e [FIX] hr_timesheet_invoice: make tax test more independent of master data
bzr revid: stephane.bidoul@acsone.eu-20121030145537-u4jdutaw2mzdur39
2012-10-30 15:55:37 +01:00
Stéphane Bidoul c186d01d8e [FIX] invoice tasks work: default to account tax when product has no tax
lp bug: https://launchpad.net/bugs/1048305 fixed

bzr revid: stephane.bidoul@acsone.eu-20121030112632-7cbfv7xgzqnua6i5
2012-10-30 12:26:32 +01:00
Stéphane Bidoul da8fcd15e1 hr_timesheet: enumerate list of month in English
lp bug: https://launchpad.net/bugs/1060224 fixed

bzr revid: stephane.bidoul@acsone.eu-20121002141943-efh2cea9zrkzh6u2
2012-10-02 16:19:43 +02:00
Stéphane Bidoul 38dfccaaa0 hr_timesheet_invoice: in invoice task work, use the account default tax if the product has no taxes defined
lp bug: https://launchpad.net/bugs/1048305 fixed

bzr revid: stephane.bidoul@acsone.eu-20120909165919-xgxu45ugq3944gvu
2012-09-09 18:59:19 +02:00
Stéphane Bidoul 4deb1f84e7 hr_timesheet_invoice, bill task work: use the analytic account company for the generated invoice_cost_create
This makes life much easiers for people generating billings for several companies.

lp bug: https://launchpad.net/bugs/1047826 fixed

bzr revid: stephane.bidoul@acsone.eu-20120909152438-qax5pv4ij76asmbv
2012-09-09 17:24:38 +02:00
Stéphane Bidoul 17edcf0630 select account and taxes for the invoice's company instead of the user's default company when changing product or account
This partially fixes lp:1048213 since the default account proposed when creating a new invoice line (in trunk only) is still from the user's company.

lp bug: https://launchpad.net/bugs/1048213 fixed

bzr revid: stephane.bidoul@acsone.eu-20120909124259-df6qo743sfogltf9
2012-09-09 14:42:59 +02:00
Stéphane Bidoul 004b9c9a84 create invoice: changing journal changes company too
lp bug: https://launchpad.net/bugs/1047884 fixed

bzr revid: stephane.bidoul@acsone.eu-20120909114515-mbilk7jv2aj1mn9x
2012-09-09 13:45:15 +02:00
Stéphane Bidoul a181497d66 Duplicating project must reset analytic account code, like duplicating an analytic account does; this is a workaround for bug lp:888315
lp bug: https://launchpad.net/bugs/888315 fixed

bzr revid: stephane.bidoul@acsone.eu-20120829105645-vlzhsaihz76t572l
2012-08-29 12:56:45 +02:00