Commit Graph
17 Commits
Author SHA1 Message Date
svs-odoo 37906f7506 [IMP] uom: add surface UoM
Adds a new UoM category (surface) and two UoM: m² and ft²
Could be useful for some kind of products like paper or fabric.

task-2443585

closes odoo/odoo#66174

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-03-23 17:06:37 +00:00
Pratima Gupta acd67ab477 [IMP] uom: added mm uom for length of product package
Changed the uom of product package if product_length_in_feet_param
of ir config parameter for product is not 1. Previously its value
was meter.
For following fields updated the uom -
1) packaging_length
2) width
3) height

closes odoo/odoo#64735

Taskid: 2418421
Related: odoo/upgrade#2089
Related: odoo/enterprise#15848
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-03-22 05:00:01 +00:00
Christophe Monniez 44af06132e [FIX] uom: move product_uom_dozen back to data
In commit ab76c421c2 the Dozens unit of measure was moved to demo data.
Unfortunately, this data is used in enterprise module product_unspc in a
post init hook.

As a consequence, when installing this module without demo data, the
initialization crashes.

With this commit, the Dozens uom is moved back to regular data.

closes odoo/odoo#63120

X-original-commit: e194c39e044710cbf314427d77bd2b87795c34ff
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-12-10 06:53:31 +00:00
Victor Feyens ab76c421c2 [IMP] uom: protect/warn against uom changes/deletion
1) forbid deletion of main uoms & categories

2) warn modifications of main uoms data.
Except for the working Hours uom, which isn't a strict UoM
representation and could change between countries (and/or be deleted).

3) Also move the Dozen UoM to demo datas, it's a confusing UoM and isn't
used by the majority of databases.

4) Restrict deletion of used uoms on main models.
On sale orders and account moves the uoms couldn't be deleted thanks to the
SQL constraint covering the display_type logic, but the generic error message
is more clear for a user when deleting an uom.
2020-11-27 16:10:01 +00:00
yhu-odoo 2c5ce41c42 [IMP] uom: change default rounding to two
Change the default rouning digits of all UoMs to be two, also change the
decimal.precision of UoM to be two. Adapt all the tests.
Also to avoid hardcoded digits in `should_consume_qty` widget.

PR #56000

X-original-commit: 460ec0402a2352a5b179d81935f7230f6bc97cb7
2020-09-09 09:21:12 +00:00
Pierre Masereel bd1edc62f3 [IMP] uom: add and addapt imperial system 2020-02-04 12:57:52 +00:00
jdoutreloux 52ed0be17e [IMP] uom : remove 'measure_type' field
This removes the measure_type field which has become unused and
causes issues when users try to add new uom categories.

Task-2043927

closes odoo/odoo#41056

Related: odoo/enterprise#6945
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-13 11:19:17 +00:00
RomainLibert 02c48e71f0 [IMP] hr_timesheet: Improve general module UX (back2basics)
TaskID: 2025197

closes odoo/odoo#34855

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-16 12:03:42 +00:00
Yannick Tivisse 14067543d0 [IMP] uom: Remove parentheses on uom names
Purpose
=======

Parentheses in the label of units of measure sometimes make
reading needlessly uncomfortable.

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

Remove parentheses in the name of every standard uom.uom and hardcoded
occurence on views/field names.

TaskID: 2030444

closes odoo/odoo#34492

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-15 12:57:34 +00:00
jem-odoo a766f5b7c1 [REV] uom: introduces duration unit of measure
This reverts commit 43d51466c8.
Reasons:
- too complex having 2 UoM "Hours"
- impossible with UoM to modelise month: is that 30 days or 31 ?

Task-1971491

closes odoo/odoo#34497

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-02 08:50:37 +00:00
Christophe Simonis 93b0f9ad2a [FIX] uom: define reference UoM first 2019-06-17 14:15:58 +02:00
jem-odoo 43d51466c8 [IMP] uom: introduces duration unit of measure
This commit introduces the duration (time) units of measures, flagged as internation
unit of measure. We already have the "working time" UoM, but those ones are customizable
and might differ from the International System of Units; indeed, one working day means
8 hours (more or less) for some company.
The rational here is, when we are handling datetime, we need to get the UoM in the Odoo
System to convert the result; for instance, computing the difference between 2 datetimes
will return the number of days (or hours). But you need to match it with an odoo UoM to
extract informations from that value.

This unit of measure 'duration' is like a master data, because existing in the real world
and that many module will depend on.

Task-1971491

closes odoo/odoo#32840

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-14 12:26:41 +00:00
Victor Feyens 59059a480f [IMP] uom: rename measurement type 'time' into 'working_time'
This commit rename the measrurement_type 'time' into
'working_time' to be more precise, as time might means
duration.
This changes prepare the distinction between 'working time'
and international duration unit.

Task-1971491
2019-05-14 12:26:41 +00:00
jem-odoo e0ed50a724 [IMP] uom: unique reference UoM per category
Users can configure multiple references in a same
category. This might cause problems during conversion
and does not make sense.
Since this is a "late" constraint, we define it in
python to avoid conflict with existing data.
We allow user to have multiple unactive reference, but
force to have exactly one active. So when a new UoM
category is created, user have to encode the reference
unit first, and then the bigger/smaller ones.

This commit also update stock tests, since they were
redefining new reference UoM in the same category, and
finally, this commit provides some tests for this
uniqueness and custom UoM behavior.

Task #1820076
2018-04-09 10:13:18 +02:00
jem-odoo 2d32ff4bb8 [IMP] uom: measurement type on category
In order to restrict some uom field to some uom category, it is required to
add a measurement type on uom.category. Also, this will lessen the use of
master data.

Some technical justifications:
- measure_type is not required, to allow people creating their own
uom.category. Those ones will not interfere with addons business.
- measure_type is unique: we restrict to only one category containing
time, weight, ... in order to avoid mismatch category during conversion.
(2 different weight categories can not be converted).
- measure_type on uom.uom is stored: to allow search and domain on
field, we need to store it. Usually, UoM are not updated every day,
and the number of uom in a database is not that important.

To illustrate this mecanism, a domain is added on
'project_time_mode_id', in project module. This field
is use as timesheet default uom, and we obviously want to
restrict it to time category (timesheeting in liter does
not make sense ...)

Task #1820076
2018-04-09 10:13:06 +02:00
XavierDo 2966d4faed [IMP] product: rename product.uom into uom.uom
Also rename product.uom.categ into uom.category to
 give it a decent name.
2018-02-26 14:27:26 +01:00
XavierDo 6a378e3839 [IMP] product: move uom in a new addon
Moves UoM models, test and data to a new addon in
order to be able to use uom without product.
A simple example is be to be able to use UoM for
timesheets.

This commit only move code, and adapt xml ids
without chaging any feature or functionnal
behavior.
Note: 'product' module now depends on new
'uom' module.
2018-02-26 14:27:26 +01:00