Commit Graph
6750 Commits
Author SHA1 Message Date
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
Damien Bouvy 1e706d3069 [IMP] web, *: milk adaptations
*: hr_holidays, stock, sale, product, web, sale, purchase, stock,
   website, survey

Adapt some custom control panels (mainly for custom reports) to the
milk controlpanel.

hr_holidays:
Move the buttons to create a new time off or a new allocation to the
"create button" slot and transform it into a dropdown (creating
allocation requests is clearly a secondary action, not a primary one)

stock:
3 lines does not fit, must be on 2 lines

Part-of: odoo/odoo#116641
2023-05-12 22:59:19 +02:00
Pierre Paridans caef16ee4e [REF] web,*: ControlPanel layout
This commit brings the ControlPanel into a single line with 3 main
sections:
- buttons & breadcrumb
- layout related actions (ie. the SearchBar in multirecord view or
  ButtonBox in formView)
- navigation (pager, switch view...)

Add new search bar menu, this is a merge of the following components
into one big component display in column:
* comparison_menu
* favorite_menu
* filter_menu
* group_by_menu

Also adapt navigation hook.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +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
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +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
yhu-odoo 8b09cd722f [FIX] mrp: duplicate lot when auto-generate serial
Previous commit 1b840d066999bde1f05563567f439967770701ca tried to fix
the issue action_generate_serial may try to generate a existing lot.
But it made the lot number completely product specific. This change is
too big for stable, we revert the change in this commit.

Also to fix the issue, when action_generate_serial tries to generate a
lot, we always try the result from ir.sequence frist, only when the lot
already exists, we then try create one based on the product's lastest
lot number.

Task-3187003

closes odoo/odoo#121214

X-original-commit: 95214ab6c133553371926804e788766edab2b8ca
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2023-05-12 13:00:50 +02:00
stcc-odoo 03aa724125 [FIX] mrp{_account}: consider capacities when computing duration
Related enterprise PR: odoo/enterprise#39669

Steps to reproduce:

Install mrp_workorder
Create Product P1, Workcenter W1
Edit W1 > Specific capacities > Add line: Product = P1, Start time = 5, End time = 5
Create BoM > Product: P1, Operations tab > Add line: Workcenter = WC1, Default duration = 60:00 min > Save
Click on overview stat button
Issue:

The created operation has expected time of 60:00, instead of 70:00. The workcenter start and stop times are considered in this calculation, so the workcenter capacities should be considered too.

Solution:

Use `_get_expected_duration` to compute the expected duration.

opw-3229485

closes odoo/odoo#121060

X-original-commit: 7b5a30fb3e51434154050052ec39ed299c6094d3
Related: odoo/enterprise#40905
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-11 09:36:29 +02:00
Touati Djamel (otd) 2a5e079ef7 [FIX] mrp: unbuild a manufacturing order with a tracked product
Steps to reproduce the bug:
- Create a storable product “P1”:
    - Tracked by SN
    - BoM:
        - Component:  1 unit of “C1”

- Create a Mo to produce one unit of “P1”:
    - Confirm the MO
    - Set a new serial number “SN1” and qty done for “C1”
    - Mark as done
    - Click on “unbuild” button

Problem:
An user error is triggered: “This lot ‘SN1’ is incompatible with this
product ‘C1’

When you click on the "Unbuild" button, the `lot_id` of the finished
product is added in the context with the key `'default_lot_id'`:
https://github.com/odoo/odoo/blob/dd60647ce41547ecd00bbde45ddf564a7ada91c7/addons/mrp/models/mrp_production.py#L1977
Therefore, when creating the `stock.move.line` for the component,
even if the “lot_id” is not in the vals, we will get the “lot_id” from the context:

https://github.com/odoo/odoo/blob/d04a5b5c8c7dc13e4e911a29d1944e90587e2883/odoo/models.py#L4136

https://github.com/odoo/odoo/blob/d04a5b5c8c7dc13e4e911a29d1944e90587e2883/odoo/models.py#L1961

Then, we do a field validation via a constraint, but as the product "C1"
is not compatible with the product in lot "P1", an error is triggered:

https://github.com/odoo/odoo/blob/b9334c53b84228c00ab100ffd28620b3c923c4e6/addons/stock/models/stock_move_line.py#L94-L95

opw-3284525

closes odoo/odoo#120981

X-original-commit: 2ee59a523e12b79c1338467bcf7577a1c9b63d11
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-10 21:18:08 +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
Martin Maes 266fa04aa1 [FIX] mrp: Timer not working
On the manufacturing order, modifying the timer value does save it's value
in db but does not actualise it in the front.

The "rerun" condition is already checked in MrpTimer and does not need
to be checked in MrpTimerField

closes odoo/odoo#120385

X-original-commit: a8cfa1d26ef84aa6690d3cfa8b98b6cecf4f27d9
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-05-10 19:17:12 +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
clesgow 34656b29f7 [IMP] stock,mrp: only reserve product on the forecast
When using the Reserve / Unreserve buttons on the forecast report, this
will [un]reserve every move of the picking / production. We want to be
able to do it on a product base, so that when using the [un]reserve from
the forecast of a product, it will only affect the said product.

Part of task-3218314

Part-of: odoo/odoo#119381
2023-05-09 21:04:02 +02:00
LeDungViindoo fe21f63c5f [FIX] mrp: enforce constrains check for cost share of byproducts in MO
Steps to reproduce:

Step 1: Create new MO
Step 2: In page by-products click three dots to show column cost_share
in tree by-products
Step 3: Create new Byproduct and input cost share >100% or <0% or input
two byproducts
        where their cost share adds up to more than 100%

Expected result:
Validation error: total byproduct cost_share cannot exceed 100
or Validation error: cost_share values must be positive

Actual result:
Values saves without issue

Issue is due to `move_byproduct_ids` being removed in the mrp_production
overrides of
`write()` or `create()` and having the `_compute_move_byproduct_ids`
populate its values.
This removal is causing the constrains to not be enforced, therefore we
set the constrains
field to `move_finished_ids` since changing of this value will ensure
that the values are
correctly checked.
Note: There will be a decrease in performance since this means the
constrains will be
called whenever the MO's product to produce is changed, but hopefully it
will be
minimal since there is no simple fix for this issue.

closes odoo/odoo#120797

X-original-commit: 9d6ff93d0f5b39e939f632486a97093b59d335ef
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-09 06:07:46 +02:00
Rahul Reddiar ed3e064d52 [FIX] mrp: set duration per unit when immediate production
Previously WO duration per unit was not getting updated in WO report, since
there was no code for updating WO duration per unit while triggering immediate
production.

With this commit, WO duration per unit is updated in WO report when immediate
production is triggered.

TaskID - 3251232

closes odoo/odoo#120782

X-original-commit: 1c34d2875741da820212d5d781603fc9b270464a
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-09 06:07:41 +02:00
Adrien Minne (adrm) 2c1096da95 [IMP] web,spreadsheet_dashboard: add missing props validation
closes odoo/odoo#120323

Task: 3297417
Related: odoo/enterprise#40611
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-05-05 18:08:02 +02:00
Touati Djamel (otd) b7af38b6ec [FIX] mrp: use product unit of measure precision in BoM overview
Steps to reproduce the bug:
- Go to Decimal accuracy:
    - Select the “Product Unit of Measure”
    - Set the Value to “4”

- Create a storable product with BoM:
    - add any product as component
    - save
    - Click on the BoM overview widget

Problem:
The “Product UoM” precision is not used

opw-3288403

closes odoo/odoo#120296

X-original-commit: 837a6ca90d6944f9faf4b28e69703f5310c6ec6a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-05-03 12:39:50 +02:00
Rahul Reddiar 3182a05859 [IMP] mrp: display backorder wizard and close MO
Before this commit
==================
MO not closed even when flexible consumption is confirmed from the tablet view.
If in some operations less or more commodity is consumed then when we click on
mark as done and close mo, it only generates consumption warning wizard and the
state of MO is still in to_close and not done, since the backorder wizard is not
generated.

After this commit
=================
MO is closed along with consumption warning wizard and backorder wizard. 

TaskID - 3192078

closes odoo/odoo#119491

X-original-commit: 8bd83439e3b5ae547e4fc2e21677ab8e925cb73a
Related: odoo/enterprise#40181
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-27 17:21:50 +02:00
William Henrotin d9972ddec4 [FIX] mrp: clear finished moves
The finished move of a production order should be deleted if we change
the product to avoid having draft stock move detached from any business
documents

closes odoo/odoo#118957

Task: 3172098
X-original-commit: 4478560d7769a8a795a94aead875e02d1394dd71
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-04-24 16:57:41 +02:00
William Henrotin 008f758536 [IMP] mrp: (de)activate workorder demo data
Some demo data bill of material have workorder operation. Trying to use
them without the workorder setting activated will give an error on some
fields not instantiated.

This commit activate/deactivate the operations depending on the
workorder setting.

opw - 3229621

closes odoo/odoo#119254

X-original-commit: aaba4eb4deb3f9e10fd611924c5a24680d633537
Related: odoo/enterprise#40092
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-24 10:20:20 +02:00
Mathias Mathy (MAMA) bf155195c3 [FIX] mrp: Missing serial on mass production
Issue :
- When mass producing a tracked product, an User Error is raised on validation of splitted MO.

Reproduction :
- Create Serial storable product "Component A", Lot storable product "Component B", Serial Storable product "Finished Serial Product"
- Immediate Transfer 10 * "Component A" and 20 * "Component B"
- Create a BoM for "Finished Serial Product", consuming 1 * "Component A" and 2 * "Component B"
- Create a Manufacturing Order for 10 * "Finished Serial Product" and Confirm :
- Click on "Mass Produce", Set "First SN", Generate all the serials and Apply
- Click on "Produce All"

Task : 3274962

closes odoo/odoo#118592

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-04-20 15:21:44 +02:00
Touati Djamel (otd) 3c3c856c2b [FIX] mrp, purchase{stock,mrp}: use route set on product in orderpoint
Steps to reproduce the bug:
- Install purchase, then mrp (in this order)
- Create a storable product “P1”
    - route: buy
    - Add a supplier
    - Add a BoM
- Create a delivery for the product “P1”
- A need is created
- Go to inventory > operation > replenishment

Problem:
An orderpoint is created with the preferred route: Manufacture instead
of buy

As the "Purchase" module was installed first, the override of
the `_set_default_route_id` function will be triggered first, the 'buy'
route will be set in the created order point because the product has a
supplier. Then, the function in the MRP module will be triggered and
since the product has a BoM, the 'buy' route will be replaced by
"Manufacture".

opw-3228971

closes odoo/odoo#119172

X-original-commit: 227d038efbadf25e3a7be7cceedd9159b71162a3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-20 14:10:27 +02:00
uso-odoo 58a3fa82ff [FIX] mrp : prevent traceback while operation use in bom
When Operation is 'Archive' and it is still in use as 'Consumed in Operation' in
bom while creating Manufacturing Order and confirming it, KeyError will be
generated.

Steps to Produce:-

1) Create a new product, create bom for that product, add components, and
   create or add at least 2 operations to the BoM.
2) In the components of 'Consumed in Operation' add the newly created operation.
3) Now, Archive one operation.
4) Create new Manufacturing Order with a newly created BOM
5) Try to confirm it.

KeyError will be generated.

By applying this commit, if there are no operations left after archiving
one linked to the component then the server error won't occur

sentry - 4042593205

closes odoo/odoo#119098

X-original-commit: ba2364f9188ff44c68a1b86d5029884815a33216
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-04-20 10:51:51 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Lois Rilo 3296aee6cf [IMP] mrp: hook method to control auto confirmation of MOs
There is a bit of a dance on the lambda function to filter the MOs
that should be autoconfirmed out of a procurement. To the point
that the logic is different in v14 and v15/16.

Refs:

- v14: https://github.com/odoo/odoo/commit/5fd6c7251331de2600eaee76114b76f535652fec
- v16: https://github.com/odoo/odoo/commit/2ab878aecb67930a9a7cd35901cb6c4b98c7e442
- v16 previous: https://github.com/odoo/odoo/commit/2b003b8d3917b45772b5f16edf21292446e96601

It would be great for partners to be able to extend it and be able
to control the logic used even if the default behavior gets changed
again.

closes odoo/odoo#118761

X-original-commit: 3c5c00c6bf63a90d747ddc74b31cdced0116d74d
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-04-18 09:24:36 +02:00
yhu-odoo ff342d9e93 [FIX] mrp: duplicate lot when auto-generate serial.
To reproduce:
1. Manually create lot "0000001" for a lot product
2. Create a MO for this product and click generate-serial button.
Validation error raised since we are trying to generate lot/sn "0000001"
again.

When useing action_generate_serial, ir.sequence always try create a
lot/sn in form "00000dd". If user already created the same one, the
generation will fail.

We already tried to avoid this issue for sn in _get_next_serial() by
finding the latest sn and create new one base on it.

To fix, we also allow _get_next_serial to be applied to lot.

Part of Tast-3187003

closes odoo/odoo#118481

X-original-commit: dc69748ea2698077782d839cf7da48e987f17ffc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2023-04-13 17:57:42 +02:00
Martin Trigaux 69f911d994 [IMP] *: enforce usage of Markup in mail
When using message_post, the body format must be explicitly specified.
If html is expected, a Markup object should be used.
If text is given, the content will be escaped.

Before this PR:
message_post was unaware if the content of a message was HTML or
text. This lead to multiple situation where the content was
incorrectly considered as HTML and led to display errors.
In
  self.message_post(body="Hello %s!" % self.name)
if the name contained HTML, it would be evaluated.

In
  self.message_post(body="Contact Raoul <raoul@caramail.be>")
the email would not be displayed as considered as unknown HTML and
discarded by the sanitizer

Now each call must explict the type of content.
Use the escape() helper to properly combine Markup and translations.
It would also be acceptable to use Markup() to wrap a static
translation but escape is better as one can not guarantee the content
of a translation.

closes odoo/odoo#111850

Related: odoo/documentation#3612
Related: odoo/enterprise#36728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-13 16:39:48 +02:00
clesgow 8e2a293faf [FIX] mrp: Add support for picking replenishment in MO Overview
When a reception picking was created to resupply a component (without
using a purchase order), the picking was correctly linked in the MO
Overview, but the date was set as "Not available" as the planned date of
the picking wasn't read.
Also adds the color scheme for pickings states for the Overview.

Part of task-3217757

closes odoo/odoo#118023

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-13 15:26:42 +02:00
clesgow d8648645e3 [IMP] mrp: Add In Transit lines to MO Overview
Following odoo#116983, there's a new line indicating products still in
transit in the Forecast Report. So we can use it in the MO Overview to
better show when some products are in stock but not yet available.

Task-3217757

Part-of: odoo/odoo#118023
2023-04-13 15:26:42 +02:00
clesgow bd2a99b469 [FIX] mrp: use the right uom for replenish wizard
When opened from the MO Overview, the uom in the wizard is the one from
the product's form.
The problem is that the quantity given to it is in the overview's line
uom. So instead we add an already converted quantity to the `to_order`
lines.

Part of task-3217757

Part-of: odoo/odoo#118023
2023-04-13 15:26:42 +02:00
clesgow a145830b34 [FIX] {purchase_,}mrp: set costs for RFQ in MO Overview
While the cost of a line related to an RFQ was saved, it was not used in
the displayed costs.
Also, it used the wrong cost (don't need to factor in taxes), not did it
factor the quantity used in the cost.
Fixes as well the MO Cost for partially in-stock products.

Part of task-3217757

Part-of: odoo/odoo#118023
2023-04-13 15:26:41 +02:00
clesgow a2cc7f307b [FIX] mrp: remove duplicate replenishments in Overview
When a product was used more than once in a MO, then replenishment lines
were duplicated in the MO Overview, as it didn't check which forecast
line was already used, nor the total quantity it should have for this
replenishment.

Part of task-3217757

Part-of: odoo/odoo#118023
2023-04-13 15:26:41 +02:00
clesgow 66cddb7b27 [FIX] mrp: use the MO's deadline for overview's final product
Instead of using the `date_start` of a MO to check if the MO will be in
time for the Final product in the MO Overview, use the `date_deadline`
if it is defined instead.

Part of task-3217757

Part-of: odoo/odoo#118023
2023-04-13 15:26:41 +02:00
clesgow d4a70eab4d [FIX] {purchase_,}mrp: fix wrong uom for Overview replenishments
The MO Overview would display the wrong uom in the replenishments lines
of the MO Overview. Since the data was pulled from the forecast report
(which displays it in the product's uom), it could not coincide with the
ones used in the MO.

Part-of: odoo/odoo#118023
2023-04-13 15:26:39 +02:00
clesgow 60f4cdb6b1 [FIX] mrp: Adapt to new produce_delays
Following 6825c44, the `produce_delay` is now defined on the bom rather
than on the product, thus raising a traceback when trying to access it
from the product.

Part-of: odoo/odoo#118023
2023-04-13 15:26:39 +02:00
clesgow 77531c5a67 [IMP] mrp: Restrict shown column on done MO in Overview
Product availabilities and their related replenishments are no longer
relevant when displaying a completed MO. Therefore, those columns are
disabled in the Overview when the the MO is either done or cancelled.

Part of task-3217757

Part-of: odoo/odoo#118023
2023-04-13 15:26:39 +02:00
clesgow ce840d14ba [FIX] mrp: fix free qty not counted in to order lines
The free quantity was only checked to see if there was a reason to order
more quantity in the MO Overview, but wasn't counted in the missing
quantity to order, leading to having a `to order` line with bigger
quantity than required.

Part of task-3217757

Part-of: odoo/odoo#118023
2023-04-13 15:26:38 +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
Jorge Pinna Puissant baebb6a5b0 [REF] web, *: Unique id for field nodes
Before this commit, the field node id (`field_id`) uses the field name
for the first occurrence on the arch, and add an underscore and a number
for the rest of the occurrences. This can create inconsistencies when
sombody assumes that the field_id is equal to the name, and don't take
into account the possibility of multiple occurrences.

Now, a unique id is created since the first occurrence, this remove all
ambiguity between the id and the name.

Part-of task-id 3179751

closes odoo/odoo#117799

Related: odoo/enterprise#39511
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-11 15:17:20 +02:00
David (dafr) bfee5cca53 [FIX] mrp_workorder: fix duration_percent out of range
duration_percent field is a stored integer.
In postgresql, integer are 4 Bytes long, which create a range of -2147483648 to +2147483647.
With a small duration_expected, and a big duration, we can easily break these limits.

OPW-3253333

closes odoo/odoo#117744

X-original-commit: 97892d04341a2cbbe07e4db6442a451b0cf0b164
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: David <dafr@odoo.com>
2023-04-05 09:42:48 +02:00
Touati Djamel (otd) 97f9289058 [FIX] mrp: wrong BoM from orderpoint in 3 steps
Steps to reproduce the bug:
- Go to the warehouse settings:
    - enable “3 steps for manufacturing”
- Create a storable product “P1” with 2 BoM
- Create an orderpoint:
    - Preferred route: Manufacturing
    - Product: “P1”
    - BoM: select the second BoM
    - To order: 1

- Click on the “Order once” button

Problem:
The manufacturing order is created with the first BoM instead of the
second.

As we are in 3 steps, the “run_pull” function is triggered first, with
values prepared from the orderpoint so the bom is well set:
https://github.com/odoo/odoo/blob/16.0/addons/stock/models/stock_orderpoint.py#L515-L523

Then the “run_manufacture” function is triggered but with vals prepared
from the move, not from the orderpoint, so we lose the BoM information
that the user has selected:
https://github.com/odoo/odoo/blob/16.0/addons/stock/models/stock_move.py#L1334-L1340

opw-3217945

closes odoo/odoo#117732

X-original-commit: 2371cd29e1c0cfa54b682b2100b9db7f5633a7b4
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-04-05 09:42:46 +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
Raphael Collet c1d2e712f2 [FIX] mrp: tests with Form on 'mrp.production'
Add the group 'mrp.group_mrp_routings' on the main user to make field
'workorder_ids' visible in the form view of 'mrp.production'.  Many
tests use that view, and require the subviews of that field to be
present in order to create records.

closes odoo/odoo#116779

Related: odoo/enterprise#38858
Related: odoo/documentation#3968
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-03-31 17:02:44 +02:00
Mahamadasif Ansari 02788e4076 [IMP] various: changes tips data due to changes in digest templates
With this PR, the `digest_data` template has been changed, so the `digest_tips`
is not compatible with the new changes.

This commit changes the `digest_tips` data to be compatible with the new changes.

Below are the modules affected:
 - account
 - crm
 - digest
 - hr_expense
 - hr_timesheet
 - im_livechat
 - mrp
 - project
 - purchase
 - sale_management
 - stock
 - website

task-2717426

Part-of: odoo/odoo#89549
2023-03-31 15:51:58 +02:00
Adrien Widart (awt) 34c55c5e54 [FIX] mrp: find BoM with other picking type
To reproduce the issue:
1. In Settings, enable "Multi-Step Routes"
2. Create a second warehouse WH02
   - Let WH01 be the existing one
3. Create two storable products P_compo, P_finished
4. Create a BoM:
   - Product: P_finished
   - Components: 1 x P_compo
   - Operation Type: "WH02: Manufacturing"
5. Create a MO:
   - Product: P_finished

Error: Once the product is set, nothing defines the BoM (and
therefore the components, picking type, and so on)

When opening the MO form, the picking type is directly defined with
"WH01: Manufacturing". Therefore, when looking for a BoM, we use
that picking type as criteria -> we will not find the BoM of step 4

Notes about the fix:
- Small behaviour change: once the picking type is set, it does not
change automaticaly (whatever the BoM is)

OPW-3122384

closes odoo/odoo#116515

X-original-commit: 93381af48e20a10c3fded88f010f89cd03cc5131
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-03-24 19:21:25 +01: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
Touati Djamel (otd) fe1443885a [FIX] mrp: print structure & cost BOM's of archived products
Steps to reproduce the bug:
- Create a storable Product “p1” with BoM:
    - Add a component and a byproduct:
- Archive “P1”
- Go to BOM Overview
- Filter -> see archived BoM
- Print BOM Structure

Problem:
A traceback is triggered,`ValueError:
Expected singleton:product.product()`

The `_match_all_variant_values` function is called but without the
product, while it takes at least one:
https://github.com/odoo/odoo/blob/15.0/addons/mrp/models/mrp_bom.py#L456
https://github.com/odoo/odoo/blob/15.0/addons/mrp/models/product.py#L286

The product must be set in the `_get_pdf_line` function, in our case,
the function does not receive it as an argument, so we have to get it
from the BOM, but as the `product variant` field has not been set in
the BOM, we should get it from the product_template:

https://github.com/odoo/odoo/blob/02cd750da6a79e6aa7104473fff2ab986b6e607c/addons/mrp/report/mrp_report_bom_structure.py#L378

The `product_variant_id` field is a non-stored compute field:
https://github.com/odoo/odoo/blob/34a2948d3d6e0f597c1b5d65f9f118e891c07cc4/addons/product/models/product_template.py#L133

And in the compute function, we use the first element of the
`product_variant_ids`: https://github.com/odoo/odoo/blob/34a2948d3d6e0f597c1b5d65f9f118e891c07cc4/addons/product/models/product_template.py#L177-L179

But it is a `Many2one` field, and for this type of field we have to add
`with_context(active_test=False)` to the ORM returns all records,
active or archived.

opw-3236421

closes odoo/odoo#116207

X-original-commit: fa10dd50397f83ad88380995a65c7d722825aee1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-22 15:59:15 +01:00
Eteil Djoumatchoua(etdj) cbeaf6ffd4 [FIX] mrp: Allow to ajust real duration on workorder operation
Steps:
- Enable `Worder orders` in Manufacturing settings
- Create a manufacturing order with a bill of materials and workorder operation set and confirm
- Go to the workorder tab and start, then finish after few seconds
- Update the real duration
- Try to save

Issue:
User Error

Cause:
When writing on a `mrp.production` object we check if the production is still planned and if, it try
to plan all the workorders which are not done or cancelled. But in our case all the workorders are done
so it try to write to an empty object.

opw-3230310

closes odoo/odoo#116122

X-original-commit: 674f37fbbaa4a0d7f34f8d75d16dd11373815932
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djoumatchoua Eteil Junior (etdj) <etdj@odoo.com>
2023-03-22 09:16:40 +01:00
uso-odoo dbc3b0b5d5 [FIX] mrp : prevent error when creating new record of mrp.workorder in tree view
while we are creating a new record of the mrp.workorder from the editable list
view (mrp_production_workorder_tree_editable_view), we are getting the singleton
error, as it is not taking any production record.

by applying this commit, it will resolve that singleton error

sentry - 3982694755

closes odoo/odoo#115862

X-original-commit: 91e7d36a48d58aea1d63999dd150b543983aeba1
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-20 16:51:41 +01:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00