Commit Graph
6 Commits
Author SHA1 Message Date
Adrian Torres 1daf8eb127 [FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.

This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.

closes odoo/odoo#46325

Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-30 13:42:04 +00:00
Rémy Voet (ryv) 177a479cf6 [REF] stock: clean imports
Clean imports of the main stock module:
- Remove unsued import
- Follow odoo guidelines
- Sort them
2020-01-20 13:58:52 +00:00
Martin Trigaux a47f7ee0e4 [FIX] product: do not translate at code import
Defined as this, the label of the selection field were translated during code
import, when building the python model, not when a user access the field values
as it should (and is already the case thanks to the ORM).

Trying to translate a string when no user-context is available is not only
useless but may cause bug on services with multiple databases (e.g. a SaaS).

In a multi-worker environment, when the code is imported, the _ method will use
multiple scenarios to detect the language and get a cursor.

As we have no available cursor in the frame (method _get_cr from GettextAlias),
the fallback is made on the cursor of the request.
In a multi-worker environment, this could be a cursor linked to a database in
another language than English.
In such scenario, the selections would be translated in the language of the
other database instead of displaying it in English

opw-1881956
2018-09-14 11:20:38 +02:00
Tanguy Charlier a1a8d6d44f [MIG] barcodes: Simplify selection fields overrides 2016-06-07 17:43:35 +02:00
Thibault Delavallée d7af45bb03 [MIGR] stock: barcode, settings, planner and res_*
Those models are migrated to new API. No change is performed to code
structure or functional structure. Some code cleaning may be performed when
migrating to simplify the code. Other files may be updated due to the move
towards the new API.
2016-04-29 12:18:36 +02:00
Thibault Delavallée e28b83603b [MOV] stock: barcode, procurement, product, res_*
Move models not located in stock.py file and their views:

 - barcode
 - procurement
 - product
 - product.putaway, product.removal and stock.fixed.putaway.strat are
   extracted from product.py to their own product_strategy file
   to separate product and product.template code from stock specific
   code related to products
 - res_*
 - settings
 - web_planner

This commit only moves files. No change is done.
2016-04-29 12:18:36 +02:00