Commit Graph
74 Commits
Author SHA1 Message Date
Christophe Simonis f2b8caff07 [MERGE] forward port branch saas-15 up to 03b83abb7f 2018-09-17 17:02:40 +02:00
Christophe Simonis 03b83abb7f [MERGE] forward port branch saas-14 up to b28f705b64 2018-09-17 14:51:13 +02:00
Christophe Simonis b28f705b64 [MERGE] forward port branch 10.0 up to 69af1df70a 2018-09-17 14:15:46 +02:00
Martin Trigaux a307d4fc80 [FIX] account_asset: use the last day of fiscal year for depreciation date
The depreciation was hardcoded as starting the first of January.
If a user changed the configuration to set a different value than 31/12 it had
no impact.

In saas-11.3, this was improved to allow to configure the behaviour at 805f3a610

opw-1878927
2018-09-14 12:03:21 +02:00
Christophe Simonis 43eca3079e [MERGE] forward port branch saas-14 up to 1f92477cf4 2018-08-06 11:01:50 +02:00
Christophe Simonis 1f92477cf4 [MERGE] forward port branch 10.0 up to 2b7c525982 2018-08-06 10:29:57 +02:00
Lucas Perais (lpe) 17e50b745d [FIX] account_assets: fallback sell or dispose button
Create an asset and confirm it.
Click on Sell or Dispose
The form view of the disposal move opens

With the breadcrums, back to the asset
Click again on sell or dispose

Before this commit, literally nothing happens
This is because there is no more business to do

After this commit, in the case there is no business to do
we fallback onto the smartbutton's action

OPW 1864318
closes #26086
2018-08-01 14:16:21 +02:00
Christophe Simonis b29e053436 [MERGE] forward port branch saas-15 up to 43eca3079e 2018-08-06 11:32:12 +02:00
Nicolas Martinelli 8ee2a0d191 [FIX] account_asset: avoid company mismatch
On existing databases, the SQL not null constrain is not removed, making
the creation of new assets impossible. This is because a computed field
is not inserted at creation, but written afterwards.

This reverts commit 0c76bd3c63.

opw-1840661
2018-05-02 11:29:51 +02:00
Miquel Raïch 0c76bd3c63 [FIX] account_asset: avoid company mismatch
It was possible to change manually the company of an asset, although its category would be belonging to another company and thus its depreciation lines and journal items also.

To tackle this problem, we set the company_id field of an asset as related to its category

Was PR #23498. Courtesy of Miquel Raïch
2018-04-26 09:19:38 +02:00
Christophe Simonis ad825b673b [MERGE] forward port branch saas-15 up to bfa5af45df 2018-04-16 17:10:23 +02:00
Christophe Simonis bfa5af45df [MERGE] forward port branch saas-14 up to aab0908818 2018-04-16 14:21:00 +02:00
Christophe Simonis 412501a5dc [MERGE] forward port branch 10.0 up to 7147622665 2018-04-16 11:18:08 +02:00
Toufik Benjaa fc6d98df24 [FIX] account_asset: Allow accountant to validate invoices
- When validating an invoice, the create method of the model account.asset.asset is called.
  Accountant have the access rights to create account.asset.asset object, but they do not have the rights to write on them.
  The issue here is that the create of the account.asset.asset is done, but right after a right is done in the same object, which trigger an AccessError.
  To fix this issue, we make the write using the admin env. This doesn't cause security issues since the user needs the create accesses.

OPW-1832797
2018-04-11 12:39:48 +02:00
Christophe Simonis 9af65a7efe [MERGE] forward port branch saas-16 up to 0b188b5804 2018-01-29 13:37:12 +01:00
Christophe Simonis 0b188b5804 [MERGE] forward port branch saas-15 up to 2629029d03 2018-01-29 13:29:14 +01:00
Gustavo Valverde d62a26a429 [FIX] account_asset: Import UserError to show real error to user
The UserError was not being imported, causing the crash of this warning

Closes #22460
2018-01-25 12:46:58 +01:00
Christophe Simonis 8f1e2044cd [MERGE] forward port branch saas-16 up to 810b6aa760 2017-10-31 16:29:07 +01:00
Christophe Simonis 810b6aa760 [MERGE] forward port branch saas-15 up to d1fcca1504 2017-10-31 15:25:01 +01:00
Christophe Simonis d1fcca1504 [MERGE] forward port branch saas-14 up to a0157f104f 2017-10-31 12:36:47 +01:00
Christophe Simonis a0157f104f [MERGE] forward port branch 10.0 up to dcce040a63 2017-10-31 12:07:15 +01:00
Nicolas Martinelli bb8f41d2a6 [FIX] account_asset: do not create move
- Create an asset, post one line.
- Go back to the asset => the button is green
- Click again on the line => the button is orange

There is no protection to prevent the user to post the same entry
several times (a new account move is created every time it is clicked).

We fix the JS widget, but we add an extra layer of protection at the
Python level.

opw-778756
2017-10-30 12:21:19 +01:00
Christophe Simonis 10128fa7e8 [MERGE] forward port branch saas-16 up to dc2a6c6cd2 2017-10-20 19:27:04 +02:00
Christophe Simonis 5ea0f55d65 [MERGE] forward port branch saas-15 up to bee0c11ef7 2017-10-20 17:57:21 +02:00
Christophe Simonis bee0c11ef7 [MERGE] forward port branch saas-14 up to f3ac68ed29 2017-10-20 17:24:15 +02:00
Christophe Simonis a3b3bb2228 [MERGE] forward port branch 10.0 up to 9b4447e9aa 2017-10-19 23:16:39 +02:00
Nicolas Martinelli 4f921d668a [FIX] account_asset: asset on refund
- Create a vendor bill with a line linked to an asset category
- Validate the bill => an asset is created
- Refund the bill

The refund is also linked to an asset category. Therefore, upon
validation, a negative asset will be created.

The refund should not be linked to the asset category in a first place.
The user should cancel/modify the asset manually.

opw-775933
2017-10-19 09:26:44 +02:00
Christophe Simonis 99bf9e4563 [MERGE] forward port branch saas-16 up to 89df681b45 2017-09-28 13:24:14 +02:00
Christophe Simonis 89df681b45 [MERGE] forward port branch saas-15 up to da15615c45 2017-09-28 11:56:23 +02:00
Goffin Simon de95e6f4a8 [FIX] account_asset: float division by zero
The number of depreciations or the period length of your asset category cannot be null.

opw:773790
2017-09-25 15:35:59 +02:00
Christophe Simonis e390b0d640 [MERGE] forward port branch saas-17 up to 1e17035f71 2017-09-13 20:07:38 +02:00
Christophe Simonis 1e17035f71 [MERGE] forward port branch saas-16 up to 268cf9d04a 2017-09-13 19:32:35 +02:00
Christophe Simonis 268cf9d04a [MERGE] forward port branch saas-15 up to 127dea7f66 2017-09-13 18:45:07 +02:00
Christophe Simonis c8194a7647 [MERGE] forward port branch 10.0 up to c8b5c01340 2017-09-13 16:55:42 +02:00
Nicolas Martinelli 80ad2a370c [FIX] account_asset: deferred revenue account
- Associate a product with a "Deferred Revenue Type"
- Create a customer invoice and add the product => the account of the
  deferred revenue is used.
- Create a SO with the same product, and generate the invoice => the
  account of the deferred revenue is NOT used.

opw-769254
2017-09-12 11:06:12 +02:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Christophe Simonis 1fa8680286 [MERGE] forward port branch saas-17 up to 48b2ce60ed 2017-08-10 18:07:47 +02:00
Christophe Simonis 48b2ce60ed [MERGE] forward port branch saas-16 up to 85571bb78c 2017-08-10 17:01:05 +02:00
Christophe Simonis 85571bb78c [MERGE] forward port branch saas-15 up to dde62073ba 2017-08-10 16:22:36 +02:00
Haresh Shyara 289a487db9 [IMP] account_asset: Improve terminology for Asset/Revenue Recognition
Purpose
=======

Terms are confusing in the deferred revenue app.

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

- Rename label  "Depreciation" -> "Revenue"  in Deferred Revenue Lines wizard

- "Time method" in asset.categories shouldn't show "Number of Depreciation" but "Number of entries" instead

- In Customer Invoice visible field "Deferred Revenue Type" without developer mode

- All the menu related revenue will have same menu name "Deferred Revenues"

- Module name change to => "Deferred Revenues"

- Change module name : "Deferred revenue management for contracts" to "Deferred Revenues Management for Contracts"

- Change the label in time method 'Number of Depreciation' -> 'Number of entries'

- Also change the tooltip on Time Method
2017-08-09 17:42:26 +02:00
Lucas Perais (lpe) 3cd4672272 [FIX] account_asset: on invoice from po select right account
before this commit, when a product had its asset_category set, the account attachement to the asset_categ was righfully selected on the invoice line when creating the invoice from scratch
Though, that was not the case when the invoice was created from the po

after this commit the right symmetric behavior is back: the default account that will be selected on invoice line is the asset_category one.

opw 761033

Closes #18687
2017-08-07 13:54:29 +02:00
Christophe Simonis ed2ddeccdf [MERGE] forward port branch saas-16 up to 1b50c829ef 2017-06-15 18:46:47 +02:00
Christophe Simonis 1b50c829ef [MERGE] forward port branch saas-15 up to 9713dc2e1f 2017-06-15 18:44:16 +02:00
Christophe Simonis 96595772e0 [MERGE] forward port branch 10.0 up to dc8b473a03 2017-06-15 18:35:46 +02:00
Christophe Simonis 93e222bc08 [MERGE] forward port branch saas-11 up to 544353c865 2017-06-14 17:29:16 +02:00
Xavier Morel b897dcde15 [FIX] P3: import pattern which doesn't seem to work right
``import odoo.addons.foo as bar`` doesn't seem to properly trigger the
import hook in Python 3 (it blows up on decimal_precision and
base). Thus convert *all* examples of that pattern to the more
sensible ``from odoo.addons import foo as bar``.
2017-05-22 13:30:50 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
David Arnold b9c76ddab5 [IMP] account_asset: extensibility
Before this commit, it was not easily possible to add the seamless closing
workflow while having 2 or more depreciation boards (eg. according to accounting
standard). With this commit, I can construct the move lines independently
inherit properly and pass all created move lines to the window action.

Closes #16073
2017-04-14 16:16:52 +02:00