Commit Graph

92879 Commits

Author SHA1 Message Date
Raphael Collet 9aad3d873b [IMP] fields: turn field.digits and column.digits into dynamic properties
The computed value of parameter digits is no longer stored into fields and
columns; instead the value is recomputed everytime it is needed.  Note that
performance is not an issue, since the method `get_precision` of model
'decimal.precision' is cached by the orm.  This simplifies the management of
digits on fields and saves about 300Kb per registry.
2015-03-23 14:36:15 +01:00
Raphael Collet bf703fd9a3 [FIX] models: reorder the base classes of models following an equivalent class hierarchy
Sometimes, the expected mro of the model is not the same as the one built with
a binary class hierarchy.  So we reorder the base classes in order to match the
equivalent binary class hierarchy.  This also fixes the cases where duplicates
appear in base classes.
2015-03-23 14:36:14 +01:00
Raphael Collet 9bce04de79 [IMP] models: build a flat hierarchy of classes for models
Instead of composing classes in a binary tree hierarchy, we make one class that
inherits from all its base classes.  This avoids keeping intermediate data
structures for columns, inherits, constraints, etc.  This saves about 600Kb per
registry.
2015-03-23 14:36:14 +01:00
Raphael Collet 0f9b452c33 [IMP] models: convert deprecated model._all_columns into a dynamic property
The mappings model._all_columns takes quite some memory (around 2MB per
registry) because of the numerous dictionaries (one per model) and inefficient
memory storage of column_info.  Since it is deprecated and almost no longer
used, it can be computed on demand.
2015-03-23 14:36:14 +01:00
Raphael Collet e2ea691cef [IMP] ormcache: turn it into a global LRU cache shared among registries
The ormcache is now shared among registries.  The cached methods use keys like
(DBNAME, MODELNAME, METHOD, args...).  This allows registries with high load to
use more cache than other registries.
2015-03-23 14:36:14 +01:00
Denis Ledoux e3a80afbaf [FIX] im_livechat: prevent translation of JS snippet
QWeb templates can be translated, javascript code
included. Nothing prevents you to translate
the javascript reserved word "undefined", for instance.

Preventing the livechat JS snippet to be translated
prevent translations mistakes, like translate
```undefined``` by ```Niet gedefinieerd```

opw-630335
2015-03-23 13:50:23 +01:00
Josse Colpaert 23873da6b6 [FIX] stock: quant_ids relations should not be copied when copying moves fixes #5848
The same holds for the inverse history_ids relationship.  When an object is copied,
the many2many fields their links are copied.

When we copy a done move as is done in the return wizard to create the reverse, it copied also
 the relationship with the quants.  This is problematic as this field indicates the quants that
were transferred by the move and the new move will think it will have returned all the quants
even before it is done.
2015-03-23 10:15:57 +01:00
Christophe Simonis 77a75d4e1f [FIX] web: remove leftover `future_display_name`.
see 694fe1f
2015-03-21 15:59:05 +01:00
Nicolas Lempereur efe8bfe5f1 [FIX] report_invoice: minor css fix to right align
A field was not rightly aligned in a report, this fix add a class which fixes this.

opw-630789 (fix by gab)
2015-03-20 16:16:07 +01:00
Nicolas Piganeau accd3b472a Fix unwanted opening of stock.picking when scrapping from production 2015-03-20 12:12:12 +01:00
Nicolas Lempereur d539be329e [FIX] view_form: add context to search_count
Currently, the view_form search_count doesn't propagate the context, so when
searching on a translated field, the count can be different than the one we
would expect and get with a search in a current language different than en_US.

opw-628792 opw-630212 closes #5825
2015-03-20 10:39:33 +01:00
Christophe Simonis 7780004f95 [FIX] web: correct many2one dropdown visibility.
The dropdown should only be append to visible elements.
2015-03-19 18:41:45 +01:00
Goffin Simon ac67ce4ecc [FIX] stock: quants not being reserved correctly
`product_qty` field is not recomputed at record creation.
Force field recomputation at any change
Removing the trigger on `product.product` should not be a problem as
product uom can't be changed once there are move lines.

opw:629650
2015-03-19 15:01:54 +01:00
Nicolas Martinelli 3da6c1a610 [FIX] web_calendar: reactivate the possibility to remove a calendar from side list
It is now possible again to remove a calendar from the side list
thanks to the 'X'

opw: 629511
2015-03-19 13:26:37 +01:00
Goffin Simon 05908a0fac [FIX] account_payment: supplier invoice on more then one payment oder
The field move_line_id in payment.order.form only shows account move lines that still have
an amount to pay. This was lost during 333e83f.
2015-03-18 16:45:25 +01:00
Dharmraj Jhala 01f2c5c9d2 [IMP] Allow custom ordering of files contained in zip dumps
This will allow to speed up our migration platform: as funzip can pipe
the output of the first file of the archive, even if the file is not
fully unzipped yet. This is useful to plays with dump.sql without waiting
for the full archive decompression.
2015-03-18 14:22:22 +01:00
Olivier Dony d93148240b [FIX] ir.model.data: update_dummy should mark `inherits` parents too
When a `noupdate` record is processed during an update,
the update_dummy method marks the record as "seen" so
it won't be deleted at the garbage collection step,
and seen as an obsolete external ID.

This needs to be done also for the parent records via
_inherits, because they have also received an implicit
external ID at creation, and must not be garbage
collected, even if their `noupdate` flag (db side)
is not set because the flag was added later.

This rare problem could be reproduced by creating a product
in a module, then referencing it in e.g. a sales order,
then updating the module after changing the product
record to be in a `noupdate` block.
At the end of the update the implicit product.template
record would be garbage collected, and trigger a cascade
deletion of its children - blocked by the SO reference
to the product.
2015-03-18 14:10:18 +01:00
Olivier Dony d8c4e4fa76 [FIX] product: unused import as of 489a96c257 2015-03-18 14:10:18 +01:00
Olivier Dony 694fe1fb3f [FIX] web: remove deprecated hack for future_display_name
This temporary patch was used to simulate the presence of a
`display_name` field in all models. It is not needed anymore
as of version 8.0, which comes with the actual magic to make
`display_name` work everywhere.
2015-03-18 14:10:18 +01:00
Christophe Simonis e27744df0c [MERGE] forward port of branch saas-3 up to b79f64f 2015-03-18 13:16:23 +01:00
Antony Lesuisse 7dbd495985 [IMP] website: server actions allow trailing paths 2015-03-18 13:10:58 +01:00
Christophe Simonis b79f64f1f8 [MERGE] forward port of branch 7.0 up to e1daaff 2015-03-18 12:52:33 +01:00
Nicolas Lempereur e1daaff8e0 [FIX] kanban: propagate context of many2many field
Propagate the context in kanban view when displaying a many2many field.

fixes #5623, closes #5681

opw-629698
2015-03-18 12:32:24 +01:00
Olivier Dony 489a96c257 [FIX] product.template: name_search order + mismatch on IDs
Improve commit bf31ab6718a8b9c8afdd29120e5056533b0a2ade:
 - do not use the product.product name_search() when there is no
   search term (it's only useful with a search term
 - do not use the product.product name_search() when the extra
   domain (args) has a criterion on IDs - these will be *template*
   ids, not *variant* ids, so the results would be wrong
 - Since templates and variants use a different natural `_order`,
   perform an extra name_search() on templates after gathering the
   ids to return, to apply the proper sort ordering. Increases the
   penalty by doing 2 name_search() calls.

This issue could be seen e.g. in the breadcrumbs where the
display_name variable is displayed for templates, and indirectly
relies on name_search() due to an old hack in call_kw in order to
implement the "future_display_name".
2015-03-18 11:40:51 +01:00
Raphael Collet 6aa28a89bb [FIX] models: compute many2many field on existing records when field is introduced by an update 2015-03-18 09:43:45 +01:00
Christophe Simonis 98c1a82e68 [FIX] mail, share: correct module update.
a6eac0f08e introduced a new `res.groups`
belonging to the "Sharing" category.
As this group has the flag `shared`, it is ignore when generating the
group's user view (and its virtual fields).

When updating `mail` module, the `share` module (which depend on mail)
is not loaded yet. This mean this new group is taken into account when
getting the `res.users` virtual fields.
As this group belong to the same category as the `share.group_share_user`
group but dont have an inheritance link between them (`implied_ids`),
they are generated as `boolean` instead of a single entry `selection`
field. This create a missmatch between the fields and the previously
generated view, which forbid inheritance application.

Force view regeneration, to avoid it.

Also change the group's category as this group is purely technical and
must be hidden anyway.
2015-03-17 19:29:54 +01:00
Jeremy Kersten 082a6ce0ab [FIX] point_of_sale: don't overwritte title from pos template 2015-03-17 18:53:26 +01:00
Josse Colpaert fffd52a16b [FIX] stock: Inventory theoretical qty should only consider the location itself, not its children. Same for reservations.
When the theoretical_qty of the stock is calculated, we should only consider the location itself, not its children.
That way you can have correct inventory for e.g. iPads that are both in Stock and Stock/Shelf 1
2015-03-17 17:17:44 +01:00
Josse Colpaert 50cdacba90 [FIX] stock: search qty available correction when searching zero quantities
When =, >=, <= 0 it cannot use the read_group of quants because the results will not be in the read_group Fixes #5701
2015-03-17 16:50:50 +01:00
Nicolas Martinelli 3d05ddab50 [FIX] sale_stock: Cancel all procurements linked to a sale order
During the creation of a Sale Order containing a product for which 'Make To Order' is activated
in the Procurements, two procurements are created:
- one for 'Partner Locations/Customers' location
- one for 'WH/Stock' location

If the Sale Order if cancelled, the user must first cancel the picking (delivery order).
This will trigger the cancellation of the procurement with the 'Partner Locations/Customers'
location.

The new behavior is to cancel the procurements linked to the Sale Order, which will trigger
the cancellation of the picking.

opw: 630170
issue: https://github.com/odoo/odoo/issues/3805
2015-03-17 16:37:24 +01:00
Olivier Dony 3239d5fb74 [FIX] account_payment: typo in 9562bf8398 2015-03-17 15:50:11 +01:00
Olivier Dony 6411619811 [FIX] account_payment: typo in 9562bf8398 2015-03-17 15:45:00 +01:00
Raphael Collet e182da22f4 [FIX] base/ir_model: upon custom field creation, always clear manual fields in registry
The invalidation in registry was done only if the field's model was already in
registry.  This situation is not the case when you create a custom model with a
custom field.
2015-03-17 11:51:22 +01:00
Goffin Simon d117bad18c [FIX] point_of_sale: invalid tax amount on grouped entries
If "Group Journal Items" option is checked, the generated accounting entries may get an invalid tax amout.
This will happen when several entries for the same product do not use the same tax amout (e.g. discount).
Avoid grouping products with different taxes under the same line by creating one line per tax_code_id.

opw 626695
2015-03-17 10:16:56 +01:00
Goffin Simon e2ccc5709b [FIX] account_asset: wrong currency to compute the residual amount of an asset
The result of the residual amount of an asset is : asset.purchase_value - amount - asset.salvage_value
where purchase_value and asset.salvage_value are in the currency of the asset. Amount is the difference
between debit and credit of an account move line expressed in the currency of the company.
This is why the amount must be convert in the currency of the asset.
2015-03-17 08:51:43 +01:00
Jeremy Kersten b6a528fbf0 [IMP] website: improve list of template for html editor when we edit a report
Since commit 0167acb, the template used in translate_doc are added to the list
of template when we are editing a report with the html editor.
It's nice, but we don't have all the dependicies from this one.

Now we recompute the list of template, to have all the related templates:
the external_layer* and all templates which overload this report.
2015-03-16 20:22:28 +01:00
Goffin Simon 01c983919c [FIX] website: to keep the spaces around the translations
We keep the original spaces around the translations to avoid
missing spaces between words.
2015-03-16 17:03:50 +01:00
Raphael Collet 7ac4639a24 [FIX] fields: fix determination of `field.selection` for custom fields
In the case of custom fields, `field.selection` is set directly instead of
being set in overridden fields.
2015-03-16 15:34:16 +01:00
Goffin Simon 5733ee865e [FIX] website: no interpretation for "\2060" on mac with google chrome
On mac with google chrome, the character "\2060" has no interpretation
and a small square is displayed instead.

opw: 630276
2015-03-16 12:37:40 +01:00
David Monjoie 373b560511 [FIX] account: added check if country has a code
It is possible, if the user created a new country by himself, to have a country without a code, we then need to check that.

Fixes opw 629891, where the customer wrote "Belgie" trying to find "België", didn't find it and created a new "Belgie" country without code.
2015-03-16 10:35:01 +01:00
Goffin Simon 2606e37b18 [FIX] account_asset: currency problem with depreciation in asset management
The amount used to create an account asset depreciation line must be in
the currency of the asset.
opw: 628663
2015-03-16 09:28:24 +01:00
Matt Choplin 17c1556208 [CLA] Matt Choplin
Closes #5753
2015-03-13 15:59:54 +01:00
Robert Rübner adde3e9569 [CLA] bloopark systems GmbH
Closes #5617
2015-03-13 15:01:51 +01:00
Goffin Simon 4530faae8b [FIX] account_payment: compute amount to pay
compute the amount_to_pay with  function field amount_residual on
account.move.line

opw:628903, 628428
2015-03-13 14:09:46 +01:00
Josse Colpaert 20312e2880 [IMP] Deleting PO lines should work the same way as Cancelling PO
Also the test is adapted.  When a product as treated as MTO, it should not
without notice change to an MTS.
2015-03-13 13:58:19 +01:00
Josse Colpaert 09abac7608 [FIX] Stock: Make sure inventory works with packs and lot = False
The inventory should work with packs.  If a pack is not indicated
in the inventory line, it means we correct the quantity for the product
that is not in a pack.

Also, when the lot is False, it should not behave as normal stock moves.
It should correct for the quantity that has no lot.

We try to reconcile the negative quants in the pack also.
2015-03-13 12:11:17 +01:00
Josse Colpaert 57593e5898 [IMP] stock: picking report should show only what is reserved when partially available
Only when the picking is partially available, the system will only show the amount of products available.
That way, when working with paper, the warehouse operator will only get what is available.  This is the case
where we did not launch the bar code interface or the transfer wizard.
2015-03-13 11:48:32 +01:00
Commandant Custo deb1db281b [FIX] account: Missing label for partner VAT in invoice report
Missing label for partner VAT field in invoice report
2015-03-13 11:50:01 +01:00
Thomas Groutars 7e0ff24cca [FIX] base: delete cascade value mapping on server action deletion
When deleting a server action, its fields_lines were not deleted.
It causes an issue for example in this case:

Create a new custom field on any model
Create a server action with
Action To Do: Write on a Record
Base model: model of the custom field
Add a line in the value mapping,
using the custom field you just created

Delete the server action

Delete the custom field => Throws an error because
required field col1 is not defined
on the ir_server_object_lines object
2015-03-13 11:25:08 +01:00
Fabien Pinckaers 4491c20bf0 Merge pull request #5728 from apertoso/8.0_fix_nl_BE_naming
[FIX] nl_BE language name
2015-03-12 15:28:07 -07:00