Commit Graph
821 Commits
Author SHA1 Message Date
yhu-odoo 6faafdefa3 [REM] mrp: remove report "Manufacturing Order"
The report "Manufacturing Orders" is just the graph/pivot view of MO,
most of the infomation can be found on a more accurate report
"Production Analysis".
In this commit, we removed "Manufacturing Orders" from the report view.
Users can still access it from Operations -> Manfacturing Orders ->
graph/pivot view.

Task-2695732

closes odoo/odoo#130342

Related: odoo/enterprise#44912
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-08-23 18:55:03 +02:00
yhu-odoo f9867a5fa5 [IMP] mrp, *stock*: change move quantity reporting
Currently on stock moves, product_uom_qty indicates the demand qty
before the move is done and it indicates the acutual done qty when
the move is done.
As a result,  when validate a stock move with qty_done !=
product_uom_qty, a new move is always created for the difference.
And the product_uom_qty of the original move will be changed to match
qty_done.

In this commit, we change to that product_uom_qty will always indicate
the demand qty, and qty_done will always indicate actually done
quantity.
To do that, when underconsumption, we won't split the move when no
backorder. and when overconsumption, we will always merge the extra move
back to the original move.

Task-2695732

Part-of: odoo/odoo#130342
2023-08-23 18:55:02 +02:00
yhu-odoo a8977a7c76 [FIX] mrp: manual_consumption field can't save
The field manual_consumption field on mrp.bom is computed,
`readonly=False` should be added to make sure it's changable.
Also on the form view, `force_save="1"` should be added to make sure the
value will be saved since we make it readonly in some cases on the view.

closes odoo/odoo#132600

X-original-commit: 4bdfd0d1e0d95af92a1afae5888e9e587fc4994e
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2023-08-22 20:00:15 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Gorash 1e12f68a1d [REF] base,all: Update modifier syntax: prepare view migration
These changes are made as a result of simplifying attrs and 'states' in
views.

Before applying the migration script, it is necessary to fix some views.
These views are erroneous and either work by chance or are simply
untested. We have for example wrong domains, elements used by modifiers
but not present in the view, obsolete domain operators, inherit views
not targeting the right views, xpaths using attributes as target, the
use of %(...)s in views, false attribute value types in python.

Part-of: odoo/odoo#104741
2023-08-18 09:49:12 +02:00
Rahul Reddiar e7bd0cf464 [IMP] mrp_workorder: transform the button_start and button_pending methods
With this commit
================
Removed 'action_mass_start' and 'action_mass_pause' methods also
the 'button_start' and 'button_pending' methods have been modified
to accommodate multiple work orders, ensuring seamless functionality.

closes odoo/odoo#130663

Related: odoo/enterprise#45883
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-17 18:42:36 +02:00
Tiffany Chang (tic) 33cc629001 [FIX] mrp,repair,stock{_dropshipping}: correct show_operations visible
PR #106911 added the new picking.type for repair and hide the
`show_operations` field from its form view. Unfortunately this writes
over the existing invisible attr for mrp_operation (depending on the
order of module installation, otherwise mrp will do the same to repair).
Therefore we update the attribute logic to only include the picking
types that should have the field visible (incoming, outgoing, internal,
and dropship).

closes odoo/odoo#132012

X-original-commit: 1688a8d82ce7aec32f17fc8c35295cccbb682dd6
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-16 17:47:27 +02:00
Hardik Domadiya a669cad446 [FIX] mrp: persist expected duration when generating BoM
Before this commit
==================
When creating a BOM through a MO (form view), the WO expected duration is reset
to the default value on the source MO as well as the corresponding Operations in
the BOM.

Steps to Produce
=================
- Create a MO with 1+ WOs and set an expected duration for the WOs.
- Generate a BOM through the MO and observe the changed duration after saving
the BOM

After this commit
=================
After this commit the operation/WO duration doesn't reset to default values.

task - 3414446

closes odoo/odoo#129390

X-original-commit: 05d0dc26e24f24107a5e443dc9ccafd0ff7a1af9
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-07-24 23:03:56 +02:00
Arnold Moyaux ff32acbb86 [IMP] mrp: auto_install enterprise module
Part-of: odoo/odoo#127250
2023-07-20 11:49:27 +02:00
3dda30d265 [IMP] mrp: preparations for MES
In `mrp_workorder` (enterprise), we're adding a new view to process
manufacture orders and workorders: MES.
These changes are more or less related to MES. See following for the
main changes.

== Be able to mass produce an ongoing production order ==

Currently once the mo is in progress it's not possible to use
the mass produce feature anymore. Even in basic cases where the
componenets are not tracked. It's also not possible to mark
all the productions directly as done. It's needed in the
mrp display action, so we enable it everywhere

== Manage different flows with tracking ==

Currently there is 2 different flows:
- No tracking -> All the quantities easy
- Lot -> All the quantities + display button to create lot number
- Serial with component not tracked or only one: Mass produce
- Serial that require a match between components SN/Lot and finished
product serial number -> Only display it as one unit with an automatic
backorder/

task-3231200

Part-of: odoo/odoo#127250
Co-authored-by: R1D1CUL0US <clpi@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
2023-07-20 11:49:27 +02:00
Julien Carion (juca) 6c412be2ea [IMP] *: coherent hotkey uses
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.

task-3370463

closes odoo/odoo#127469

Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 18:24:15 +02:00
mano-odoo 3df4eaff92 [FIX] *: minor settings spacing issues
The purpose of this commit is to review the responsiveness and spacing
of some settings that were visually broken.

The nested checkboxes were growing too much on smaller screens
making the content overflow.

This commit adapts these checkboxes settings to make them more readable
and consistent.

It also review the input that overflow similarly to nested checkboxes
such as the count of extra hours in attendances settings.

In 16.2 some SCSS was added to control field widget spacing on mobile,
however it was breaking the layout for the `.o_boolean_fields`.

Task-3113372

closes odoo/odoo#126347

X-original-commit: 80aa03e86bd47e6349a5fa69397857fdf6a8cc0b
Related: odoo/enterprise#43142
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-07-17 19:26:03 +02:00
Benoit Socias d1292a96a6 [IMP] base,*: support image/webp image format
*: mail, mrp, test_website, web, web_editor

Before this commit '.webp' images could not be used in odoo.

After this commit '.webp' images can be uploaded to odoo.
- can be used in image field
- can be used in HTML field image
- can be used in mails and website
- can be transformed (shape mask, filter effect, crop, rotate, resize,
  adjust quality)

task-2774352

Part-of: odoo/odoo#85494
2023-07-15 05:10:45 +02:00
Elisabeth Dickinson 7f205c23d7 [FIX] project, mrp, website_slides: improve status buttons layout
Related to commit 45b9e04.
This commit fixes the overflowing status buttons in the MRP module's
Workcenter view. It also adapts the font-size of one of the status
buttons texts in website_slides by wrapping it inside the usual
structure: .o_stat_info > .o_stat_text`.
The same fixes were done for project, stock and sale_timesheet

task-3326558
part of task-3326263

closes odoo/odoo#127555

X-original-commit: odoo/odoo@f0b3806
Related: odoo/enterprise#43726
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-06 17:52:25 +02:00
Chrysanthe (chgo) 93c76dba6b [FIX] mrp: fix badge color
=== ISSUE ===

If you navigate to Inventory > Manufacturing > Kanban view, there is a
color contrast issue with some badges. The text inside is black
by default but sometimes the color is dark enough to not
meet WCAG contrasts.

=== AFTER ===

We use the `.text-bg-x` class instead, which handle both `color` and
`background-color` at the same time.

task-3397937
part of task-3326263

closes odoo/odoo#127333

X-original-commit: 75c58ef8265013b39a7a9ddd55e764b2b6ff138a
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 23:06:39 +02:00
svs-odoo a072096913 [FIX] mrp: link by-product moves to the BoM
Before this commit, when the MO's BoM is updated, the MO's by-products
are created. These moves have a field, `byproduct_id`, who is supposed
to link the move to the BoM's by-product's line, but this field is
let empty when the move is created.
It's because the field is missing in the MO's form view. This commit had
it (invisible) so moves' `byproduct_id` will be correctly filled.

closes odoo/odoo#110227

Related: odoo/enterprise#35969
Related: odoo/upgrade#4428
Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-06-19 16:39:34 +02:00
svs-odoo d7392829c7 [IMP] mrp: update BoM button
The "Update BoM" button action was moved from `mrp_plm` to `mrp` so it
can be displayed if the BoM was updated now. This action can be called
for confirmed MO now.
Each time a change is done on a BoM, all the draft and confirmed MOs
using this BoM will be notified the BoM changed, thanks to a new boolean
field, `bom_has_been_updated`.

An exception however: if the MO is confirmed and the BoM's product was
changed, the MO shouldn't have the "Update BoM" button displayed.
Otherwise, it would change the finished product of a confirmed MO.

Also, it's important to notice than due to a limitation, only changes
done at the BoM level will mark it as modified. That means that
modifying subrecords in their own views (for example, adding steps in a
BoM's operation) will not mark the BoM as updated !

See odoo/enterprise#35969
task-3089368

Part-of: odoo/odoo#110227
2023-06-19 16:39:34 +02:00
svs-odoo e831903612 [IMP] mrp: generate BoM from a MO
In a Manufacturing Order, if the user manufactures a product without any
BoM, they can generate a new BoM who will take the information from the
MO. So, the new BoM will have a BoM line for each MO's component, an
operation for each MO's work order, and the By-Product lines will be
copied too.

task-3089368

Part-of: odoo/odoo#110227
2023-06-19 16:39:33 +02:00
JF Aubert 65b06f3eff [FIX] mrp: fix planning by workcenter
Since https://github.com/odoo/odoo/commit/926c4d4769db1846d94e2ab5a3e9b02308b0b160
planning by workcenter no longer takes into account unavailabilities of
less than 1 day in month mode, leading to erroneous accumulations
because some calendar unavailabilities (for example from day 5:00 p.m.
to day+1 8:00 a.m.) are missing.
We return to the previous behavior by transmitting all the unavailabilities.

The planning by production no longer displays the unavailability of workcenters.

closes odoo/odoo#123898

Task: 3305266
X-original-commit: d7a803cfbed7aa28d0835f9db974802d4b6f77d1
Related: odoo/enterprise#42017
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Jean-Francois Aubert (ajf) <ajf@odoo.com>
2023-06-06 14:48:30 +02:00
Ahmed Khalaf 23a75f5a7a [FIX] mrp: MO search fields duplicate name
This commit adds `workcenter_id` as the workcenter search field used to
have the same name as the `name` search field in the `mrp.production`
search view.

Part-of: odoo/odoo#114708
2023-06-01 11:43:43 +02:00
Ahmed Khalaf 096be6e66e [IMP] mrp: add MRP barcode setting
This commit adds an option to enable the barcode app in the mrp
settings page

Task Id: 3052744

Part-of: odoo/odoo#114708
2023-06-01 11:43:43 +02:00
niyasraphy efaeabaaa6 [FIX] mrp: clear product variant onchanging product in bom
before this commit, on changing the product from bom is
not clearing the product variant field, if the product
variant feature is not activated in the database.

* activate the product variant in the db
* create a product and variants
* open bill of material, and set the created
product as product and set any variant in product
variant field
* now go to settings and disable product variant feature
* come back to same bom and change the product
* the product variant field will still have the other
product

onchange_product_tmpl_id is written to clear the
product variant field value, but as the product
variant field has group the onchange value is
not getting updated.

after this commit, on changing the product the product
variant field will get cleared even if the product
variant feature is not activated.

closes odoo/odoo#122681

X-original-commit: 5808fc898ecbbf23d93693f7d957a6700de144c6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-05-26 17:29:27 +02:00
Pieter Claeys (clpi) a080337d7e [IMP] stock,mrp: allow scrapping of kits
When creating a scrap order on a product which has at least one kit BoM, an option is added to create a scrap order for this kit.
The user can select from the kit BoMs of this product and the scrap order will add stock moves for all the components of the selected kit instead of for the product itself.

Task: 2479234 (nr 9)
Community PR: https://github.com/odoo/odoo/pull/114315
Enterprise PR: https://github.com/odoo/enterprise/pull/37764

Part-of: odoo/odoo#114315
2023-05-25 16:28:55 +02:00
Pieter Claeys (clpi) 9ce0fcba50 [IMP] mrp: production view updates
Add the scheduled production end date to the form and list views and
reorder the filter list.

Also fixes a bug where the end date of an MO without any workorders
was set incorrectly upon closing the MO.

Task: 2479234 (nr 5)
Community PR: https://github.com/odoo/odoo/pull/114315
Enterprise PR: https://github.com/odoo/enterprise/pull/37764

Part-of: odoo/odoo#114315
2023-05-25 16:28:55 +02:00
Pieter Claeys (clpi) 7d73a070d5 [IMP] mrp: show+search lot/serial in workorder kanban
Adds the option to search workorders by lot or serial number and
displays the lot/serial number on the workorder kanban view
(if applicable).

Task: 2479234 (nrs 3,10)
Community PR: https://github.com/odoo/odoo/pull/114315
Enterprise PR: https://github.com/odoo/enterprise/pull/37764

Part-of: odoo/odoo#114315
2023-05-25 16:28:55 +02:00
Martin Maes 928ccc243c [FIX] mrp: Bom typo
Changed Overview to BoM overview

Task-3184663

X-original-commit: bb1598b6df53f9184fac8ff831cc0ba201d0812c
Part-of: odoo/odoo#121783
2023-05-23 16:31:51 +02:00
Brieuc-brd ee75969979 [IMP] *: app icons: replace svg to png
The introduction of Milk has brought new app icons.
Using the svg format creates a lack of anti-aliasing on the edges of the
shapes, which makes the icons look bad.
Since the png size has been reduced, we can afford to use the png format
to have the best possible quality without having a lack of performance.

task-3326633
Part of task-3326263

X-original-commit: e07cb722f2b11407a3ad093bd688b7d37afd5a88
Part-of: odoo/odoo#121886
2023-05-22 13:54:07 +02:00
yhu-odoo 0171f4a1e4 [FIX] {,purchase_}mrp: add missing days when calculate DTPMO
When calculate Days to Prepare Manufacturing Order, we didn't take into
account Days to Purchase and Security Lead times for Purchaseing of the
company. In this commmit, if the (sub-)bom has company_id set, these two
days will added to the calculation.

Task-3078049

X-original-commit: bf59aedad649dec350f091bb074d3ef1e51d5fcb
Part-of: odoo/odoo#121813
2023-05-19 16:42:07 +02:00
clesgow 2f73020e08 [FIX] mrp: replace workcenter times when specific capacity is defined
Currently, when a specific capacity is defined for a product in a
workcenter, if a setup / cleanup time is given, it will be added to the
existing setup / cleanup time of the workcenter.

What we want instead is to be able to fully define what the
setup/cleanup time is for this specific product. So the given times in
the specific capacity override the times defined in the workcenter for
that specific product.

To help with that, we set the workcenter's setup/cleanup time as a
default for their related specific capacities, since if not changed,
they will follow the workcenter times.

Updated the tests so their specified capacities match the new behaviour.

closes odoo/odoo#119212

Related: odoo/upgrade#4576
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-15 18:50:16 +02:00
Elisabeth Dickinson 45b9e04db4 [IMP] *: status buttons fix
Part-of: odoo/odoo#116641
2023-05-12 22:59:23 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
stefanorigano (SRI) 051ac37232 [IMP] web, * :introduce o_avatar
*: account, gamification, mail, mrp, note, project, website_blog,
   website_event_track.

Uniform design defining a common element shared across different
modules.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +02:00
Martin Maes 596f6bab3d [FIX] mrp: MO planned when all WO are planned
This pr fixes a bug where a validation error occurs in the timesheet
wizard.
Indeed, when the user enter manually a start or end date in a workorder,
the whole MO becomes "plan".
The problem here was that if the user opens the wizard of another
workorder (on the same MO) that has no start/ end date set, and then if
he saves (no matter if he changed something), it will trigger a
validation error because the start and end date of the workorder is
required in that view if the MO is planned.

closes odoo/odoo#120386

X-original-commit: c9728858aa46e6cb1a3d39cbc8da8e175007e456
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-05-10 19:17:15 +02:00
clesgow 2118bbe452 [FIX] mrp: Refer to mrp.production in Manufacturings list
Steps to reproduce :
- Install stock, mrp
- Go to Inventory -> Operations -> Manufacturings
- No MO could be found

The view showed `stock.picking` having a 'manufacturing'
picking_type_code. Now instead shows a list of `mrp.production` as it is
done when clicking on the 'Manufacturing' type in the stock Overview.

Part of task-3218314

Part-of: odoo/odoo#119381
2023-05-09 21:04:02 +02:00
Matheus Leal Viana (malv) 794d1407e0 [FIX] mrp: Modify hotkey of scrap action in MO
Steps to reproduce:

Go to Manufacturing App
Click on some MO
When pressing the 'ALT' shortcut key the Scrap and Cancel tabs offer the letter 'Z'.
According to this spreadsheet
the scrap action (line 79) should be assigned to shortkey 'Y'

OPW-3202893

closes odoo/odoo#118075

X-original-commit: 577a467ca757b1d0c02e13e0710f2c0216c1e6a0
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: malv-odoo <malv@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-04-12 12:26:02 +02:00
Hansun (hale) 0d4a89ac9d [FIX] mrp: broken UI of Work Center Setting
1. Install [Manufacturing] on Apps
2. On [Settings]>[Manufacturing]
- toggle on [Work Orders], [Quality] & [Quality Worksheet]
3. Go to Manufacturing
- Work Centers (a.k.a WC) Overview should be visible
- if no W.C. by default, add from [Configuration]>[Work Centers]
4. click on the 3 dots at the top right corner of each WC card

Issue: ugly layout
Fix: restore the style

affected branch: saas-16.1 up to master

closes odoo/odoo#117695

X-original-commit: 40a5d29d9b5b4070269175a83866837c7725b8c9
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-04-04 21:11:45 +02:00
Louis Wicket (wil) 0c53d28133 [IMP] *: remove "French spacing"
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#116167

Related: odoo/enterprise#38542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-24 12:50:13 +01:00
Martin Maes a4e441e885 [IMP] mrp: added mass start stop on workorders
This commit add a mass start and stop buttons that allows to start
or stop multiple workorder at the same time.
Starting a workorder checks if the user needs to be logged and
if the workorder is not blocked.
This commit also change the appearance of the mark as done button

task id : 3216277

Part-of: odoo/odoo#114901
2023-03-17 19:21:54 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
JF Aubert d4ed9f8a50 [IMP] mrp*: Merge workorder and production scheduled/effective dates
Since starting a workorder and marking it as done replaces the
planned dates with the actual ones,
there is no need to keep dates which will always end up being the same.

task: 3108291

see odoo/enterprise#36102
see odoo/upgrade#4247

closes odoo/odoo#110550

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-14 11:07:56 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
Hubert Van de Walle (huvw) 9b136383c2 [FIX] web,mrp,stock: don't call action buttons for virtual records in x2manys
Steps to reproduce
==================

- Make sure the "Work Orders" setting is enabled
- Manufacturing > Products > Bills of Materials > New
- Select a random product
- In the Operations tab, add a line
- Type something in the Operation field
- Set the workcenter to Assembly line 1
- Save and close
- Click on the "Show Instructions" action button

```
Traceback (most recent call last):
  File "/home/hubert/src/16.0/odoo/odoo/models.py", line 5108, in ensure_one
    _id, = self._ids
    ^^^^
ValueError: not enough values to unpack (expected 1, got 0)
```

Cause of the issue
==================

The action is called without in id because the record is not yet created

Solution
========

The button should display a warning in x2manys when the record is virtual.
This was actually the case before Odoo 16 but there was an option on the
button `options='{"warn": true}'`. With this commit, it will be the
default behavior.
We also remove this option from the xml since it isn't used.

sentry-3950549982

closes odoo/odoo#114505

X-original-commit: 9fc0424a4450923aa8582bdb6766e1b19cb68546
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-03-07 18:02:53 +01:00
JF Aubert 6825c440d5 [IMP] mrp: Move fields from product to bom
Manufacturing lead time & Days to prepare are now handled at bom level

Task: 2907698
Part-of: odoo/odoo#107952
2023-03-07 01:59:16 +01:00
clesgow 1ef03b92a0 [IMP] {purchase_,}mrp: Add MO Overview
Adds in a new report that allows the user to monitor the entire
production of a product, including the resupply of the components (i.e.
subassemblies, purchases, ...) in a single view.

Task-3059467

Part-of: odoo/odoo#113394
2023-03-03 18:10:57 +01:00
Martin Maes 09314106e2 [IMP] mrp_workorder: employee login in workorder list view
This main feature of this commit is adding the possibility to login with multiple employees on the list view of workorders.

There is now a button in the header that will allow to log in as an employee in the list view.
The flow is the following :
- The employee logs in
- He becomes the "admin" of the session and his name appears next to the log out button.
- If another employee logs in, he will become admin and the first one will no longer be visible in the header.
- The employee will start timesheeting on the workorder if he press the start button. Notice that the employees working on the workorder will appear in the last column of every work_order record.
- If this second employee logs out, the first one will not become admin automatically. He will first need to click on his name/avatar in the popup and will be asked his pin code (if needed) to log in again.

There is also a way to assign employees to a workorder.
A filter will help retreive the workorder on wich the admin of the session has been assigned.
In addition, a new button in the header allows to mark as done multiple workorders at once.

The timer component has been updated to avoid wrong values if the computer goes to sleep mode.

The wizard of the workorders allowing to see the time traking has also be modified (switching tabs).

From a more technical point of vue, the employees and admin will be saved in the session.
The employees working on a workorder will be saved on the record.

related : https://github.com/odoo/enterprise/pull/34786

Part-of: odoo/odoo#107473
2023-03-03 17:04:47 +01:00
yhu-odoo 5bb0f96f19 [IMP] mrp: manual consumption improvement
Previously we set a component on MO to be manual consumption by comparing
the To Consume and Consumed, if they are not the same, we consider it a
manual consumption. Now if any input activity in the Consumed cell, we
will consider it a manual consumption.

Note that in the code, we make the css class change happended in the
list renderer instead of the field widget. We do that because we want to
change the background color of the whole cell not just the text of the
field.

Task-3116125

Part-of: odoo/odoo#113538
2023-03-01 17:01:16 +01:00
yhu-odoo 439ba7d945 [FIX] mrp: show manual consumption when workorder not enabled
In 49bc9aac201136e684cac9d84df97f80d217afa4, when we need operation_id
when we check if manual_consumption is readonly or not, so
groups="mrp.group_mrp_routings" was added for manual_consumption.
As a result, we can't see manual_consumption on BOM when workorder is
not enabled.
To fix, we add a computed field as a workaround.

Task-3116125

Part-of: odoo/odoo#113538
2023-03-01 17:01:16 +01:00
Bruno BoiandMathieu Duckerts-Antoine d19037e141 [IMP] web,*: better classes handling in view archs
**Before this commit**
- The optional "class" attribute set on the root node of a view arch
  is ignored, except for the kanban view which has a custom
  way of using it.
- The optional "js_class" attribute set on the root node of a view arch
  does not have any impact on the class names passed to its controller.

**After this commit**
The content of the optional attribute "class" set on the root node of an
arch like in

<list class="o_custom_class">
    ...
</list>

as well as an additionnal class derived [1] from the value of the
"js_class" attribute set on the root node of an arch like in

<list js_class="extended_list">
    ...
</list>

will both be found in the prop "className" of any view controller.

[1] a js_class value of "xyz" yields to the class "o_xyz_view"

**Note on this commit**
The kanban view was already appending the root node class attribute
to its renderer element. This is no longer the case and some styling
rules has been adapted.

closes odoo/odoo#113014

Related: odoo/enterprise#37265
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2023-03-01 17:01:03 +01:00
Bruno Boi af00a92b3e [REM] *: remove unused class 'oe_background_grey'
This class is a ghost from the past.
Last related style has been found in da86f505a

Part-of: odoo/odoo#113014
2023-03-01 17:01:02 +01:00