Commit Graph

94819 Commits

Author SHA1 Message Date
Raphael Collet 5676d8121d [FIX] fields: invalidate x2many fields with a domain
Invalidate the cache of a x2many field when any of the fields appearing in its
domain is modified.  Use the invalidation triggers mechanism for that purpose.
2016-05-09 12:10:23 +02:00
Denis Ledoux 7923999f12 [FIX] google_calendar: user invited to one recurring event occurence only
When a Google user was invited to one occurrence of a recurring event,
but not to the recurring event itself (and the other occurrences, therefore),
and the user owner of the recurring event did not sync his calendar in Odoo,
the event occurrence could not be synced in Odoo, because it attempted
to attach it to the parent/main recurring event, which was not present
in Odoo.

In such a case, Odoo now syncs the event occurrence as a simple classic
event. In addition, if the owner of the event sync his calendar with Odoo
afterwards, or if the user is invited later to the main/parent recurring event
and then sync again his calendar,
it then attach the event occurrence that was previously
synced to this main event, to avoid events duplication.

opw-676535
2016-05-09 11:39:38 +02:00
Nicolas Lempereur dd714ace55 [IMP] web: multi-click on save on view form (no fp)
When clicking on save several time when editing a view form it can be
saved several times which can be an issue for one to many.

The normal happenstance when saving should be as follow:

-> save (click)
-> wait write result
-> received write result
-> reload the form with updated data and updates buttons

But when clicking several time, it could become:

-> save (click)
-> wait write result
-> received write result
-> save (click)
-> wait write result
-> received write result
-> reload the form with updated data and updates buttons

This commit only reinstate the saving feature once the form is reloaded.

closes #11926
opw-671793

note: no need to forward-port
2016-05-09 10:54:16 +02:00
Odoo Translation Bot 859fe655d2 [I18N] Update translation terms from Transifex 2016-05-08 02:57:57 +02:00
Nicolas Lempereur 48a35ca8f9 [IMP] product: order attribute by name
closes #11951
fixes #11602
opw-673857
2016-05-06 16:38:47 +02:00
Olivier Dony c8dc4c8daf [MERGE] Forward-port 7.0 up to a0484cbe45 2016-05-05 03:52:47 +02:00
Olivier Dony a0484cbe45 [FIX] import: broken translation cache for absent translation of 'false'
Backport of 7d732b1011

Fixes #979
2016-05-05 03:39:54 +02:00
Olivier Dony 7cafe6a9c1 [FIX] account: set reconciliation date as admin
The user performing reconciliations may not always
have the right to update the corresponding partners,
for example if a partner is also a system user.

Doing it as super-user after verifying that the
user is indeed allowed to reconcile journal items
works around the problem.

Fixes #11931
2016-05-05 03:37:08 +02:00
Adrien Peiffer (ACSONE) 9ac9869a57
[FIX] purchase: Context propagation in wkf_confirm_order.
Closes #11916
2016-05-04 15:39:00 +02:00
Adrien Peiffer (ACSONE) e664d3074c [FIX] account: A negative amount with sale taxes on bank statement line must be considered as a refund. Courtesy of Adrien Peiffer (ACSONE). PR #11877 2016-05-04 11:31:20 +02:00
Goffin Simon e588d85315 [FIX] product_expiry: 'product_id' in context
When creating a new lot from an incoming picking transfer, the product_id
is written in the context.

opw:674608
2016-05-03 09:40:41 +02:00
Holger Brunn a4c4c43bd9
[FIX] project: make copy overridable in v8 api
Without the proper decorator, the method is matched as `cr_ui_context`.
This is because the `guess` mechanism expects a name `res_id` instead of
`record_id`.
For stability reason it is better to add the decorator than modify the signature
of the method.
Closes #11735
2016-05-02 12:08:06 +02:00
Frederik Kramer d6563f91b9
[CLA] update signature of initos
Changes due to changes in the legal form of the company
Closes #11759
2016-05-02 12:08:06 +02:00
Odoo Translation Bot 8651d0815d [I18N] Update translation terms from Transifex 2016-05-01 02:57:51 +02:00
Odoo Translation Bot 534b7c5553 [I18N] Update translation terms from Transifex 2016-05-01 00:28:37 +02:00
Raphael Collet ba5f5614f3 [FIX] expression: fix missing results in direct search on many2many fields
This case corresponds to searches like `[(field, 'ilike', name)]` where `field`
is a many2many field.  The domain processing performs a `name_search` on the
field's comodel, then makes the relation match the returned record ids.

Problem: the call to `name_search` uses the default limit (100), and this makes
the search return less results than expected.  Make the search complete by
forcing `limit=None`.
2016-04-29 15:48:19 +02:00
Raphael Collet c7baab6789 [FIX] expression: fix missing results in direct search on many2many fields
This case corresponds to searches like `[(field, 'ilike', name)]` where `field`
is a many2many field.  The domain processing performs a `name_search` on the
field's comodel, then makes the relation match the returned record ids.

Problem: the call to `name_search` uses the default limit (100), and this makes
the search return less results than expected.  Make the search complete by
forcing `limit=None`.
2016-04-29 15:45:21 +02:00
Raphael Collet 233c7780e6 [FIX] fields: filter result of 2many related fields with related_sudo
When traversing relational fields as superuser, you end up with a recordset for
which only a subset is accessible to the current user.  An earlier fix to this
issue completely dropped the `related_sudo` feature; change its implementation
to keep the feature.
2016-04-28 11:46:44 +02:00
Stefan Rijnhart 0c2f7bdbc2 [FIX] tools: export translated fields not included in _columns
Non-stored new API computed fields are only defined in _fields
but not in _columns, and they were never exported within translation
files.

Closes #9081
2016-04-26 19:12:51 +02:00
Christophe Simonis 7e51d98553 [FIX] calendar: correct search on mail.message and ir.attachment
Handle the case of immutable (tuple) domain leafs.
2016-04-26 14:55:41 +02:00
Goffin Simon d812175390 [FIX] account_asset: asset_create
When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.

Used case:

- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice

Before the fix: the asset is created twice.
After the fix: the asset is created once.

opw:674674
2016-04-26 10:39:27 +02:00
Nicolas Martinelli f5eae92f12 [FIX] website_sale: log if no pricelist
The pricelist field is not a mandatory field on the partner. A default
value is usually defined for any new partner created. However, if the
pricelist is manually removed from the partner, errors (tracebacks) will
occur in the eCommerce when no pricelist is found.

We cannot make the field mandatory, as it could potentially break the
workflow of some users which are not using eCommerce. Therefore, we
simply log an error message to help debugging.

opw-673453
2016-04-26 10:14:56 +02:00
Ludwik Trammer 61c808b774
[FIX] web: Allow for translation of a login error message
Closes #11815
2016-04-25 16:03:27 +02:00
Denis Ledoux dc1b8a5a51 [FIX] res_company: some information missed on company creation
On the `res.company` model, the fields
`name`, `phone`, `email`, `website`, `vat` are
related field on the `partner_id` of the company.

When creating a new company, the partner
associated to the company is created automatically,
it's handled in the overrided `create` method
of the model, but it forgots the values
`phone`, `email`, `website`, `vat` at the moment
the partner is being created.

opw-675526
2016-04-25 12:37:06 +02:00
Odoo Translation Bot 0410d1187b [I18N] Update translation terms from Transifex 2016-04-24 02:59:16 +02:00
Raphael Collet 86d276b4bb [FIX] models: fix *2many multi-onchange bug
This fixes the case where the lines of a one2many field are modified several
times by onchange methods: instead of retrieving the most recent updates, we
merge them with former updates.

This solution was written as an improvement of a proposal made by Alexis
Delattre and Sébastien Beau as #11620.
2016-04-22 16:25:11 +02:00
Martin Trigaux fd7a7207ac
[FIX] orm: do not save empty translation as 'false'
When writting a value on a translatable field in a different language than
English, the submitted *raw* value was saved in the database.

This could cause the following issues:
- empty value (provided as `False` by the web client) saved as the string
  'false' in the translations table
- no encoding or sanitization convertion
- ignore size parameter on the translatable field

Process the submitted translation through symbol_set method to clean it before
storing it blindly in the database.

This allows to convert `False` into `''` for empty value and fixes #10862
2016-04-22 16:14:19 +02:00
Adrien Peiffer (ACSONE) 600f884524 [FIX] account: Allow to select sale taxes in bank statement reconciliation process. Courtesy of adrienpeiffer. PR #11673 2016-04-22 15:25:10 +02:00
Levent Karakas 7c584d3ebb
[FIX] sale: untranslated label
attribute string is translatable on a search filter, not name (which is used as fallback label
Closes #10419
2016-04-22 13:49:12 +02:00
Levent Karakas 9d445442ef
[FIX] mail: mail template translation
Do not match with source
Closes #11789
2016-04-22 09:09:34 +02:00
Denis Ledoux 28e0a1771c [FIX] ir_qweb: regression of 8395f0d217
This revision corrects a regression introduced by
8395f0d217e16df18fcc6f4309fe74b0dd8d50a2:
the possibility to call
`ir.qweb.field.datetime`.`value_to_html` with
a datetime string directly, instead of calling
`ir.qweb.field.datetime`.`record_to_html`
(which call `value_to_html` as well).

opw-675427
2016-04-21 18:35:25 +02:00
Denis Ledoux 8395f0d217 [FIX] website_event: event dates within event timezone
The dates of an event on the website was always
within the user timezone. If not signed in,
it was within the public user timezone
(which is quite not user-friendly to change)

For this purpose, we weed get the context
from the record (the context used when using
`record.with_context`), and therefore
the QWeb field
`ir.qweb.field.datetime` is slightly altered,
to use the context from the record.

opw-675427
2016-04-21 17:52:36 +02:00
Goffin Simon 7f05692cb9 [FIX] account_asset: compute depreciation board
From af61494
Allow to compute the depreciation when the asset is in state: draft
2016-04-21 16:12:32 +02:00
Denis Ledoux db699e86b4 [FIX] mail: Missing translation `Send a message to the group`
The above string was not translated, when creating a new
discussion group, in the group message input placeholder.

opw-673712
2016-04-21 14:16:40 +02:00
Nicolas Martinelli d951a7d5ee [FIX] stock_account: stock history view
The stock history doesn't take into account internal moves. For example,
in the following situation:
- Receive 1000 products to Internal Warehouse 1
- Move these 1000 products to Internal Warehouse 2

The 1000 products are still recorded on the Internal Warehouse 1.

opw-672277
2016-04-21 11:24:49 +02:00
Nicolas Martinelli e21de5013d [FIX] membership: update membership state daily
This is a complement to commit 6d4a78a2a. The 'invoiced' status should
be removed automatically once the membership is expired.

opw-672259
2016-04-21 08:29:58 +02:00
oihane 630f3d566f [FIX] hr_timesheet_invoice: fully qualify grouped fields in SQL view
Avoids name collisions when custom columns are involved.

Closes #11743
2016-04-20 16:13:13 +02:00
Nicolas Martinelli b112631bef [FIX] stock_landed_costs: precision
Oversight of commit bd025cda.
I'm an idiot, I should have checked that another solution was applied
from 9.0 with accounting refactoring. We apply it here as well.
2016-04-20 14:05:32 +02:00
Nicolas Martinelli eb26694e0f [FIX] stock_landed_costs: account/valuation inconsistencies
When stock landed costs are divided per product unit, inconsistencies
may arise between the real stock valuation and the stock valuation
account. This is likely to happen when several products are bought, but
these products leave the stock one at a time.

A numerical example is the following: a landed cost of 15.00 is applied
to a purchase of 13 units. An amount of 15.00 is recorded when the
products enter the stock. If the product leave the stock one at a time,
13 entries of 1.15 are recorded (15.00/13 = 1.153846... ≈ 1.15), which
is then equal to 13 * 1.15 = 14.95. In this case, All the products have
left the stock (stock valuation is zero), but 5 cents remain on the
account.

This is of course even worse the higher the ratio is. For example, a
landed cost of 4.00 split into 1000 units sold piece by piece will never
be recorded when a product leaves the stock.

The fix is to record the rounding difference on a specific quant. In the
previous example, instead of adding 1.153846... on the unit cost of the
13 units, we do the following:
- 12 units to which we add 1.15 on unit cost
- 1 unit to which we add 1.20 on unit cost

opw-675222
2016-04-20 13:09:25 +02:00
Nicolas Martinelli 262d98bb69 [FIX] stock_account: account/valuation inconsistencies
When the product price is divided per product unit, inconsistencies
may arise between the real stock valuation and the stock valuation
account. This is likely to happen when a product is bought in a UoM
different from the standard UoM of the product.

A numerical example is the following: a box of 13 is bought for 15.00.
An amount of 15.00 is recorded when the products enter the stock. If the
product leave the stock one at a time, 13 entries of 1.15 are recorded
(15.00/13 = 1.153846... ≈ 1.15), which is then equal to
13 * 1.15 = 14.95. In this case, All the products have left the stock
(stock valuation is zero), but 5 cents remain on the account.

This is of course even worse the higher the ratio is. For example, a
box of 4.00 split into 1000 units sold piece by piece will never be
recorded when a product leaves the stock.

The fix is to record the rounding difference on a specific quant. In the
previous example, instead of adding 1.153846... on the unit cost of the
13 units, we do the following:
- 12 units to which we add 1.15 on unit cost
- 1 unit to which we add 1.20 on unit cost

opw-675222
2016-04-20 13:09:25 +02:00
Nicolas Martinelli bd025cda6a [FIX] stock_landed_costs: former_cost_per_unit precision
The precision of `former_cost_per_unit` should not be set. Indeed, a
stock move can contain several quants with different unit prices.
Therefore, we should not round the field when stored, otherwise the
difference per unit will not be calculated correctly.

This is a workaround since we cannot change the DB structure in stable.

opw-675222
2016-04-20 13:09:24 +02:00
Nicolas Martinelli 85fd972149 [FIX] stock_landed_costs: use correct UoM
Use the normalized quantity, otherwise the amount per unit is wrongly
calculated.
2016-04-20 13:09:24 +02:00
Olivier Dony fc2aa73606 [FIX] web: fix db manager layout in Chrome 50
Complement of f992c8ee19,
to be reverted in saas-6+ and in 8.0 when Chrome's
fix reaches the stable Chrome channel.

Fixes #11629

See https://bugs.chromium.org/p/chromium/issues/detail?id=603507
2016-04-20 11:42:03 +02:00
Joren Van Onder d043fd03ce [FIX] point_of_sale: display correct uom on weighable products
Everything's displayed fine on orderlines with weighable products, this
only affected the small blue labels on the products.

opw-674264
2016-04-20 11:09:07 +02:00
Stephen Medina 92f1cbeb6f
[FIX] server: support psutils >= 4.0
In version 3, process.memory_info() returns only rss and vms
In version 4, it now returns rss, vms, shared, text, lib, data and dirty
Automatic unpacking is no longer possible in 4.0

Fixes #11052, Closes #11459
2016-04-20 09:13:27 +02:00
Stephen Medina 58d99909ec
[CLA] signature for stephen144
signature #11459
2016-04-20 09:13:27 +02:00
Eduardo Rodríguez Crespo 364e80f718
[CLA] signature for erocre
Closes #11639
2016-04-20 09:13:27 +02:00
Olivier Dony 7f6bd2dc66 [FIX] web: fix layout issue in Chrome 50 (again)
Makes the fix in f992c8ee19
specific to the view manager of the main oe_application
container, in order to avoid disrupting other view manager
occurrences (such as the ones in modal windows or x2many
list views).

Fixes #11629 (again)

Note: Hopefully the Blink team will fix Chrome so we can
get rid of this hack in the future:
  https://bugs.chromium.org/p/chromium/issues/detail?id=603507
2016-04-19 17:44:24 +02:00
Denis Ledoux e1a17b433d [FIX] audittrail: prevent loop between models having *2m between each other
When setting rules on models having o2m/m2m relationship
between each other
e.g.
- `res.partner`:
  o2m `sale_order_ids` to `sale.order`
- `sale.order`
  o2m `message_follower_ids` to `res.partner`

an infinite loop could occur if records
of these models referenced records of the
other models in their o2m relationships
e.g.
 - `res.partner` ID 68:
   `sale.order` ID 9 in its `sale_order_ids`
 - `sale.order` ID 9:
   `res.partner` ID 68 in its `message_partner_ids`

This revision solves this use case, by passing the already
treated records in the context and checking that the records
haven't yet be treated before making the recursive call.

This revision makes sure to not break the API of methods
`get_data_context` and `prepare_audittrail_log_line`
(a new parameter had to be introduced for the above purpose)

opw-670904
2016-04-19 16:56:20 +02:00
Stefan Rijnhart 04765d4917 [FIX] hw_escpos: RBG images do not necessarily have an alpha channel 2016-04-19 15:34:45 +02:00