Commit Graph
653 Commits
Author SHA1 Message Date
Tiffany Chang (tic) 0b60c863ef [IMP] mrp: don't require consumed widget when multi-location
Before this commit, it was required to always use the widget to edit the
consumed quantity of a component when multi-location or packages setting
is active. This was not user friendly so this commit relaxes the
requirement to only tracked products and gives users the option to still
edit the consumed move lines directly if desired. We also distinguish
between when using the widget is required or not with the widget button
color. Note that if quantity consumed is greater than amount reserved in
different locations, the difference will default to the move's source
location (this is consistent with what happens when the `qty_producing`
is changed in the MO and the consumed quantities are scaled to match.)

Task: 2518523
Upgrade PR: odoo/upgrade#2655

closes odoo/odoo#73939

Related: odoo/enterprise#19732
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-07-26 12:04:30 +00:00
Tiffany Chang (tic) 1e2c03a47d [FIX] mrp: lock MOs by default
Previous specification of making MOs unlocked by default was confusing
for users and made it too easy to accidentally change the qty to consume
rather than the consumed amount. This fix makes it so MOs are now locked
by default and will be unlocked/locked (including existing draft /
confirmed / in progress MOs) automatically when setting is changed.
Previous setting (Lock Quantities To Consume) has been repurposed for
this. When setting is active, no lock/unlock button will be visible to
match the updated setting description (i.e. non-done MOs can
never be locked).

Task: 2518523
ENT PR (only fixes test): odoo/enterprise#19732
Upgrade PR: odoo/upgrade#2655
2021-07-26 11:57:50 +00:00
Achraf (abz) dec5b354bb [FIX] mrp: Close workorder form view on button clik
This PR reverts this one https://github.com/odoo/odoo/pull/54364

because it introduces the following problem:
It is no longer possible to close the dialog when it is opened from a gantt view, because the buttons are overridden and they no longer close the window after the action.

In addition to the fact that this fix no longer makes sense at the moment

opw-2591597

closes odoo/odoo#74105

X-original-commit: ed09c16234f240fd52a5cc516465767b736fb40d
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2021-07-22 10:53:17 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
Rémy Voet (ryv) 2461543aad [FIX] mrp: make the unbuild form more scalable
Making a dynamic domain with a `allowed_xxx_ids` field is a bad idea
when the domain doesn't filter out the most of records. It can create a
performance issue, if the `allowed_xxx_ids` contains too much ids, then
a lot of data will be exchange to/from server for each onchange which
slows down all the form views.

task-2558097
2021-07-13 06:57:17 +00:00
Géry Debongnie 10dadb9121 [FIX] mrp: fix incorrect domain definition
A domain used in a ir action in mrp was syntaxically incorrect.
Strangely enough, it was nonetheless accepted by pyjs.  However, pyjs
was recently remade, and is now stricter, so evaluating this domain
correctly throws an error.

This commit simply fixes the domain.

Task ID: 2601818

closes odoo/odoo#73670

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-14 08:04:52 +00:00
Rémy Voet (ryv)andnouraellm ae7e5960f1 [IMP] mrp: update workorder readiness behavior
- The work order state changes based on the availability of the components
- So if all BOM components are available the state of the first WO is set to ready
- The color of ready in the WO tree editable view will stay blue as long as done reserves the green color
- If one or multiple components are not available, the state of the first WO is set to waiting
- The color of waiting in the WO tree editable view is set to orange
By default to launch takes workorder_ready_count so it counts only ready WOs
- The user can always process the WO without restrictions even if the WO state is waiting

Task-2426773

closes odoo/odoo#71250

Related: odoo/enterprise#18523
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Co-authored-by: nouraellm <nea@odoo.com>
2021-07-13 11:53:12 +00:00
svs-odoo d2a8dc9a6d [FIX] mrp: hide operations for archived BOM
Before this commit, the operations for archived bills of materials are
still displayed in the operations list view. This commit adds a domain
on the action to hide them.

task-2417937

closes odoo/odoo#72483

X-original-commit: 1ca17dc750f6b9582acff659d9c32739fa28a1c2
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-06-21 17:36:17 +00:00
bit-odoo 800f9c499a [FW][FIX] mail, various: show only my activities shown through systray
Before this commit, suppose we have a scenario like below

  Task-A:
    Activity-1:
      name: Email ( Today )
      Assigned to: User-1
  Task-B:
    Activity-1:
      name: Email ( Today )
      assigned to: User-2
    Activity-2:
      name: Call ( Due in 3 Days )
      assigned to: User-1

When User-1 goes through the systray 'Today' filter shortcut he gets both
Task-A and Task-B in the list instead of only Task-A. Indeed currently
activities are not filtered based on current user with its deadlines.

However purpose of systray is to indicate activities current user has to
perform instead of global activities.

After this commit activities will be filtered based on deadlines as well as the
current user. In order to achieve this behavior we needed to pass a domain like
[
   ('activity_ids.date_deadline','=', fields.Date.today()),
   ('activity_ids.user_id','=', 1)
]

And for that purpose we introduced a non-stored compute field with a search
method.

Task ID-2438822
COM PR odoo/odoo#72219

X-original-commit: f4eaf4d8fb2f97240201104dcd4fc7e2674bce02
2021-06-21 07:51:00 +00:00
stefanorigano (SRI) d9a0877096 [REF] web, mrp: drop custom text decoration classes
Drop custom text decoration classes in favor of default bootstrap ones.
2021-06-18 21:31:28 +02:00
Pedro M. Baeza 9afa18a073 [FIX] mrp: Consumption and picking type are not seen for subcontracted BoMs
The consumption feature is used as well for subcontracting, but we can't
select other value from the default, as was hidden for all BoM types
except normal ones.

As the only BoM that doesn't apply the consumption feature are the kits,
then let's hide the field only on that case.

Similar can be applied to picking type, as it at least used here:

https://github.com/odoo/odoo/blob/cc0e63561f310b21511b8005c34fe99c88854cb0/addons/mrp_subcontracting/models/stock_move.py#L172

TT30389

closes odoo/odoo#72128

X-original-commit: 87a75c41a5721115c562aadca1512d1bfaa47939
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-06-14 12:10:12 +00:00
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
William Henrotin dee25dccbd [IMP] mrp: change scheduled date unplan workorders
With this commit, changing the scheduled date on a planned production
order will unplan the workorders and so highlight the 'Plan' button to
replan them from the new scheduled date.

closes odoo/odoo#71089

X-original-commit: a6783acaef3c7c2224d1cda72717a36c4b38c001
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-20 10:33:20 +00:00
yograj tandel e893651cec [IMP] *: remove widget='selection' from many2one fields
Currently, across Odoo, there are around 40+ many2one fields defined with a
'selection' widget. Since the many2one widget has options to limit record
creation and opening, there is no reason to define a many2one field with a
selection widget. The selection widget does not allow for searching, and is
limited to 100 records.

PURPOSE
to update the definition of any many2one on which we applied a 'selection'
 widget, and instead use the standard many2one widget with disabled
opening/creation instead.

after this commit,
for each many2one field defined with widget="selection",  widget="selection" is
replaced with options="{'no_open': True, 'no_create': True}"

Task : 2476488

closes odoo/odoo#68387

Related: odoo/enterprise#17316
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-20 11:01:28 +00:00
Swapnesh Shah b6e1ad0f77 [IMP] mrp: add float_time widget on durations fields
closes odoo/odoo#59692

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-06 16:09:58 +00:00
Tiffany Chang (tic) bf5e1debf9 [FIX] mrp: allow confirming of MOs without components
Prior to this commit, MOs would throw a usererror if there were no
components in it. This restriction made it so MOs created by a
replenishment (i.e. `warehouse.orderpoint`) for a BoM with no components
were never confirmed and the `qty_to_order` would accumulate for each
replenishment's new draft MO.

Steps to reproduce:
1. create a bom for a new product (w/ manufacturing route) with no
   components
2. create and confirm a sales order for the new product
3. go to Replenishment and automate the product's replenishment
4. create a new sales order for the product

Expected result: 2 confirmed MOs where the quantity of the first MO
matches the first sale order's quantity and the 2nd MO matches the
second sale order's quantity

Actual result: 2 draft MOs where the first MO matches the quantity of
the first sale order and the second MO matches the quantity of the first
sale order + the quantity of the second sale order

This commit makes it so MOs can now be confirmed even when it has no
components. Note this requires changing the logic in a few locations to
ensure expected behavior still occurs including:
- backorders are automatically confirmed.
- `reservation_state` is recalculated when expected (will be blank when
  no components).

Task: 2422698
2021-05-19 06:47:22 +00:00
William Henrotin e43c424fd9 [FIX] mrp: split call to write on stock move
You can, in a production order, change the quantity done of a stock move
raw and change its initial demand ('To Consume' field) in the same
transaction. This can lead to some issue as changing the quantity done
will update the stock move line and changing the initial demand will
unreserve the stock move thus impacting the stock move lines too.

This commit will split the values to update of a stock in move in case
the two fields have to be updated. First the stock move lines, then the
initial demand.

This commit also remove the default_product_uom_qty in the move_raw_ids
fields. This ensure the onchanges do not create/edit any stock move lines
with some reserved quantity.

opw : 2451298

closes odoo/odoo#70975

X-original-commit: e8c1f6b1a3f58b68181bf4d2599bd37efb83b5c7
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-05-18 11:58:11 +00:00
Victor Feyens 0348b95aee [FIX] *: update documentation links
Following the recent reorganisation of the documentation in 12.0+,
the majority of the documents have been moved and their old links are no longer valid.
Some redirection rules will soon be deployed, but those rules might be dropped in some years
and we want the links to still work, which is why we still replace the links to the new ones.

FW-Port of odoo/odoo#70675 (13.0)

closes odoo/odoo#70920

X-original-commit: bc9c1eef538ba6095e74c19d5d9ed9e01625ec7c
Related: odoo/enterprise#18361
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-17 19:26:27 +00:00
dht-odoo 12469ef4d3 [IMP] various: improve the sequence of menu items
- Currently all menus are out of order in app switcher.
- For example, Sales app is 16 menu away from Accounting,
  Social Marketing app is 25 menu away from Email Marketing, etc.
  So, all menus should be reordered.

- This commit will reorder the menus of the app switcher in order to reduce
  the distance between correlated applications,
  and bring the most common apps upward.
- And in this commit we have left gap of 5 subsequent sequence for further new menus.

PR: #69984
TASK ID: 2513082

Related: odoo/enterprise#17989
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-07 05:54:18 +00:00
Swapnesh d7f24257b3 [FIX] mrp: display correct uom on by products
Before this commit, It was always showing all
Unit of Measures in By Product lines.

With this commit, We are showing UoMs based on Category
of Selected Product's UoM.

closes odoo/odoo#70367

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-06 16:52:25 +00:00
JF Aubert 0b3bdcf14c [IMP] mrp: change bom operation
Ease bill of material - operation configuration.

- allow to change the BoM of an operation,
- allow to update a BoM by duplicating existing operations(& quality points),
- by extension, changing the operation of a quality point update the products.

closes odoo/odoo#65628

Task: 2413246
Related: odoo/enterprise#16159
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-04-15 09:39:45 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
yhu-odoo 93efaa8ce3 [IMP]stock,mrp: merge same components on MO
When adding extra components on MO, merge to one line if we already have
same components

Task 2446915
PR #66583
ENT PR odoo/enterprise#16554

Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-03-30 11:49:54 +00:00
Tiffany Chang (tic) 17a8258a95 [FIX] mrp, purchase, (sale_)stock: remove/update dead links
Some documentation was removed to reduce technical debt + they deemed
were self-explainatory. The links to these pages are removed to match.

Some links were also updated/changed to redirect => these links have
been updated to match the new addresses.

closes odoo/odoo#68214

Task: 2457087
X-original-commit: 49cfc4165ff19f6fd293bed2f6867a32cc0b8c5d
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-03-22 17:33:30 +00:00
svs-odoo 02bd058800 [IMP] mrp: workcenters views
Some changes on the MRP workcenter model (`mrp.workcenter`):

  - Adds a stat button in the form view to display operations used by
    the workcenter;

  - Enables the multi-edit on the list view;

  - Adds multiple fields in the list view, often as optional;

task-2382256

closes odoo/odoo#62126

Related: odoo/enterprise#17250
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-03-24 08:21:34 +00:00
svs-odoo 38ac9ccbc1 [IMP] mrp: operations listview
On the MRP operation model (`mrp.routing.workcenter`):

  - Changes the order (ordered by workcenter and BOM in priority);

  - Adds computed field, `time_computed_on`, which is only used in list
    view (display on how many numbers of work orders the duration is
    computed);

  - Adds multiple fields in list view (often optional display);

  - Adds two groupby (by BOM and by workcenter).

task-2382256
2021-03-24 08:09:17 +00:00
Rémy Voet (ryv) 0468e3ccc1 [FIX] mrp: avoid dynamic domain for product_id in MO form
Issue:
On DB with a lot of product (e.g. 50K) the MO form is very slow
open/modify. It is due to the `_compute_allowed_product_ids` which
will set the `allowed_product_ids` fields with all product ids possible
(32K), then the `convert_to_record` will take a bunch of time to filter
out no-active product.

Fix:
In your case, to avoid to send bunch of ids to the web framework and
bypass the costly `convert_to_record`, we decided to simply (static) the
domain of `product_id` (`mrp.production`). The flow will be slightly
different (doesn't filter depending of `bom_id`) but still good and
maybe better (we can now modify the product without removing the
BoM/product in the MO form).
Remove `allowed_product_ids`.

opw-2475151

closes odoo/odoo#67753

X-original-commit: a1a4f4548b395127cf7f816379a63f2d47688893
Related: odoo/upgrade#2272
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-03-12 13:00:20 +00:00
Adrien Widart e03ee35d4d [FIX] mrp: generate all stock picking
If the company uses multi-step routes, when duplicating a MO, if the
user changes the BoM, one stock picking will be missing.

To reproduce the error:
1. In Settings, enable "Multi-Step Routes"
2. Go to Inventory > Configuration > Warehouse Management > Warehouses
3. Edit the warehouse "YourCompany"
4. Set Manufacture to "Pick components, [...] products (3 steps)"
5. Create a storable product SP
6. Create two non-empty BoM (BoM01 and BoM02) for SP
    - (Hint: set a different reference for each BoM)
7. Create a MO
    - Product: SP
    - BoM: BoM01
8. Save, Mark as Todo
    - (As you can see, 2 transfers have been created: one from WH/Stock
to WH/Pre-Production, and a second one from from WH/Post-Production to
WH/Stock)
9. Duplicate the MO
10. Set BoM to BoM02
11. Save, Mark as Todo

Error: Only one transfer has been generated. The transfer from WH/Stock
to WH/Pre-Production is missing. (The duplication step is used to
compare the result. If the user saves a new MO, and then edits this MO
to change the BoM, the same problem will occur).

When confirming the MO, the module runs both pull and push rules. When
running the pull rule, the modules assigns a stock picking to a stock
move. To do so, it checks if one stock picking already exists:
https://github.com/odoo/odoo/blob/7d9264c56ac725c8d19aebad55d5668df2a8c814/addons/stock/models/stock_move.py#L863-L873
Since such a stock picking does not exist, the module creates a new one:
https://github.com/odoo/odoo/blob/7d9264c56ac725c8d19aebad55d5668df2a8c814/addons/stock/models/stock_move.py#L887-L900

When changing the BoM, an `onchange` method is raised, deletes the stock
moves linked to the first BoM and creates some new ones. However, since
`group_id` is not a field required by the view
`view_stock_move_raw_tree`, this field will not be included in the
`onchange` response.

As a result, when saving the new MO, the `write` request does not
contain the `group_id` field, so the new stock moves do not have this
information. Therefore, when running `_search_picking_for_assignation`,
the module finds a picking and does not create a new one.

OPW-2444235

closes odoo/odoo#67356

X-original-commit: b810e5ff72b892983c52b24ca7efe5025c8a7142
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-03-05 12:44:05 +00:00
nouraellm 4028868229 [FIX] mrp: avoid done and cancelled MO from todo filter
Description of the issue/feature this PR addresses:
- Fix tends to hide done/cancel MOs from mrp.production form
- A planned MO is already a confirmed MO

Current behavior before PR:
- To-do filter displays all MOs

Desired behavior after PR is merged:
- To-do filter hides MOs with done/cancel state

Task ID: 2442058

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#67008

X-original-commit: b7064d9a0bf6cc78399b61cdf862db961bbf4d5c
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Noura <nouraellm@users.noreply.github.com>
2021-03-01 14:28:37 +00:00
Goffin Simon f78e04e026 [FIX] mrp: Existing operations can only be added to one BOM
Generic operations will be applied for every manufactured product passing
through the work center.

An operation linked to a bom will only be applied when the specific manufactured bom is produced

So on a BOM, every operations must be created for this specific BOM

The widget many2many is wrong because it will overwrite the generic operations

opw:2458974

closes odoo/odoo#66888

X-original-commit: a430c06ec6ec286a2d9ef55de6eebec60feeae3f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-02-25 21:49:19 +00:00
Goffin Simon 2ad6f4e14e [FIX] mrp: Existing operations cannot be added to BOM
Steps to reproduce the bug:

- Go to an existing BOM B
- Edit B and try to add an existing operation O in operations tab

Bug:

It was impossible to add an existing operation

opw:2458974

closes odoo/odoo#66712

X-original-commit: ffab43fbf54b2f914b34c18da2391f3a18b3326c
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-02-23 15:23:44 +00:00
Nicolas Pierre b03e900a40 [IMP] stock(_*), mrp: highlight PO/SO links on forecast report
Replenishment is great to replace MTO but misses the direct link between SO and PO (smart buttons on both SO and PO to link to the corresponding PO and SO).
The info is actually there in the forecasted report but it is not accessible directly from the PO and in the case of the SO does not highlight the corresponding line of the SO.

This adds a graph icon in the PO, MO and receipt form to directly access the forecasted report (it already exists for SO and delivery).
The information linked to the SO/PO/MO/receipt/delivery is also sent to the forecasted report to highlight the corresponding line.
Note that in the case of the SO, the information needs to go first through the qty_at_date widget (which contains the link to the forecast report).

The graph icon for the PO, receipts and MO turns red when the forecasted quantity at expected date is negative. This is done using the new 'forecasted_issue' field.

closes odoo/odoo#62264

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-09 13:41:27 +00:00
Michael Mattiello (mcm) 785b304876 [IMP] *: reduce shift in form views (xml)
* account, analytic, calendar, coupon, crm, crm_iap_lead_website,
  delivery, digest, event, event_crm, fleet, gamification, hr,
  hr_expense, hr_skills, im_livechat, lunch, mail, maintenance,
  mass_mailing, membership, mrp, point_of_sale, pos_mercury, product,
  purchase, purchase_requisition, sale_management, sales_team, sms,
  stock, stock_landed_costs, survey, website_crm_partner_assign,
  website_event_exhibitor, website_event_track, website_forum,
  website_slides, base

This commit removes oe_edit_only labels and adds placeholder
on fields in form views from a lot of apps to minimize the
shift when switching mode.

task 2330101
2021-02-02 12:40:22 +00:00
Nasreddin (bon) d4bcf5b694 [FIX] gantt: Display gantt popover dates in user locale
Issue

        - Install "Manufacturing" module
	- Go to settings and activate "Master Production Schedule"
        - Install Dutch language
        - Switch user language to Dutch
        - Go to Manufacturing -> Planning -> Planning by Production
        - Hover work order

        Dates are not displayed with user locale.

Cause

        Date are formated to "YYYY-MM-DD HH:mm:ss",
        regardless the locale.

Solution

        Format date instead with locale format letters (L, LL, LTS, ...)

Doc : https://momentjs.com/docs/#/parsing/string-format/
      Go to "Locale aware formats" section

opw-2430570

closes odoo/odoo#65092

X-original-commit: 08978c6d2d14a94e6ee2fea0dedc805a56378de0
Related: odoo/enterprise#15970
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-01-26 22:48:20 +00:00
Tiffany Chang (tic) 5df928f279 [FIX] mrp: make done unbuild form readonly
Some added readonly attributes in the unbuild form view were overriding
the `states={'done': [('readonly', True)]}` attributes in the models'
fields. So we add the readonly when state='done' to the view as well.

Note that same issue exists in saas-12.3 and 13.0, but only for 2 of the
4 fields fixed in this commit (i.e. it probably isn't a big deal for
these older versions.)

Discovered during task: 2033341

closes odoo/odoo#64815

X-original-commit: 8bfa9efd989f4123b021c47f13cfe324eeb14013
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-01-20 15:35:26 +00:00
nouraellm 7cb60c72c0 [FIX] mrp: hide start button if Mo is cancelled
closes odoo/odoo#64803

Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-01-20 13:59:47 +00:00
Adrien Dieudonne 9942ee1751 [FIX] mrp: product_uom_id should be next to the field
Before this commit 'product_qty' had a width of 0 because
the 'product_uom_id' field took 100% as width on mobile.
This rule has been added by the 'oe_inline' css class.

To fix this we simply removed this class as we don't need it
on desktop: rules have been overridden by another
selector for this case.

Steps to reproduce:
- Manufacturing
- Manufacturing Orders
- Create
- Quantity field with UOM active.

Related to task ID: 1929043
2021-01-20 14:45:47 +00:00
Rémy Voet (ryv) e292c3fb53 [REF] mrp: consumption of workorder become related
Avoid duplicate information in DB.

task-2373638
2021-01-05 08:32:58 +00:00
Rémy Voet (ryv) 4d57ce473b [REF] mrp: clean BoM operations
- make `bom_id` required. No sense to have a operation without BoM
- `company_id` of operation is now related
- Clean the multiple `allowed_operation_ids` into related
fields instead.

task-2373638
2021-01-05 08:32:58 +00:00
Rémy Voet (ryv) e8be3acb83 [IMP] mrp: add indexes in mrp.workcenter.productivity model
We add a index on the workcenter_id and workorder_id, both
have a One2many related to  (`time_ids` of workcenter and workorder)
and both is in the some search domain in python (also in search view).
(Also change the `readonly='True'` into correct form `readonly=True`
of `production_id`, and remove duplicate fields `workcenter_id` in view)

task-2389380

closes odoo/odoo#63500

Related: odoo/upgrade#2042
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-12-22 12:43:00 +00:00
Rémy Voet (ryv) 876c2c33e8 [REF] mrp: remove indexes of mrp.production (date_x)
Remove index on fields `date_start` and `date_finished`. Both
has not used expected in the gantt view `view_production_gantt`
which not used anymore (and have no sense because it should use
`date_planned_start` and `date_planned_finished` instead.
Remove this old gantt view too.

task-2389380
2020-12-22 12:42:59 +00:00
svs-odoo 186a8b962b mrp,stock: rename quality_control_worksheet
Add option to install Quality Control / QC Worksheets from stock
settings.

task-2281266
2020-12-09 08:30:28 +00:00
yhu-odoo f1933add37 [IMP] mrp: install quality_worksheet in setting
Add a checkbox to install quality_worksheet in mrp setting, it will be
shown when quality_control is installed.

Task 2281266
2020-12-09 08:30:28 +00:00
Arnold Moyaux 889c261af4 [FIX] mrp: allow to use operation on BoM kit
revert of commit 2027721601890870e14b396ae4bb8b6c6dea1ac0
I tried to remove the BoM feature since mrp refactoring it would
probably create some issue and I thought that the feature was not
used. However it seems that it's write in the documentation and
some people realy use it so.

opw-2393302

closes odoo/odoo#62830

X-original-commit: 65a63216a3522922348cd57396db7de36c24a893
Related: odoo/enterprise#15137
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-12-03 13:52:51 +00:00
Goffin Simon e50b8ae8df [FIX] mrp_workorder: Qualitiy point on Kit
Steps to reproduce the bug:

- Create a BOM kit K with two components C1 and C2

Bug:

It was possible to set an operation on K

PS: Operation is not supported on BOM kit

opw:2393302

closes odoo/odoo#62455

X-original-commit: 2027721601890870e14b396ae4bb8b6c6dea1ac0
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-11-26 17:14:59 +00:00
Achraf (abz) df312153d4 [FIX] mrp_workorder: Start and pause work order without attached PDF
What are the steps to reproduce your issue ?

    1. Install 'Manufacture' and enable 'Work Order' in settings
    2. Create product 'ProductA', enable 'Manufacture' in 'Inventory' tab
    3. Create a BOM for 'ProductA'
    4. For that BOM, create a new operation called 'OperationA' with PDF worksheet but don't attach any PDF
    4. Go to 'Manufacture' and create a MO with 'ProductA', the 'OperationA' is automatically set in 'Work Orders'
    5. Start the work order

What is currently happening ?

    When you try to pause, an error is raised.
    'TypeError: Cannot read property 'pdfViewer' of undefined'

What are you expecting to happen ?

    Start and pause the work order even without attached PDF.

Why is this happening ?

    'this.pdfViewer = existing.data('PDFViewerApplication').pdfViewer'
    When there is no pdf attached. The data 'PDFViewerApplication' does not exist.

How to fix the bug ?

    Change worksheet default value to text, and make the field mandatory in case of a PDF type

opw-2387428

closes odoo/odoo#62350

X-original-commit: 8597aada3d9bacc3cff4707bb78a7bc48d723cfb
Related: odoo/enterprise#14992
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-11-25 16:38:06 +00:00
Thibault Delavallée 03c4eae63b [MOV][IMP] mrp, repair: reorganize qweb / jinja templates used for mailing
PURPOSE

Clean organization of templates in odoo apps: mail.template records in data,
qweb templates (views) used directly in code, notably using post with view.
Purpose is to ease future improvements in posting based on templates.

SPECIFICATIONS

  * move those templates in their own file to ease their discovering and
    maintenance;
  * put them into data (as those are not views even if it contains qweb)
  * guidelines are now :

    -> Qweb templates should be in data/mail_templates.xml;
    -> mail.template records should be in data/mail_template_data.xml;

  * put their declaration in no update when not done if template has no
    technical code or complex dependency on underlying code;
  * move found mail data (mail.message.subtype or mail.activity.type) records
    in a mail_data file that should contain only "core" records linked to mail;

LINKS

Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
2020-11-25 12:31:09 +00:00
Rémy Voet (ryv) 70c721e5a2 [FIX] stock: make do_unreserve faster than ever
`do_unreserve` is a action that can be made in the tree view of
`stock.picking` but it was very slow and not batched.
For 80 picking with -/+ 10 `stock.move.line` related each
(calculate on 5 sample of 80 pickings):
It took 17947 +- 2741 SQL requests, 7.37 +- 1.09 sec of SQL
and 8.13 +- 1.31 sec of python execution (+- 15.5 sec in total)

Make some  change to speed up the unreservation of
multiple picking/move:
- Batch the call of `_do_unreserve` of move in picking
- Use OrderedSet instead of RecordSet to reduce the complexity of
`_do_unreserve`. (Become significant when len(recordset) > 1000)
- Add `.with_prefetch()` in the unlink of stock move line
to patch issue with prefetching + unlink + cache.
- Batch `_recompute_state`
- Also batch the `do_unreserve` of MO

Result after change in the same samples:
It take now 1438 +-	20 SQL requests, 0.45 +- 0.02 sec of SQL
and 0.68 +- 0.02 sec of python execution (+- 1.13 sec in total,
13 times faster). Note that the gain increase proportionally.

task-2383111

closes odoo/odoo#62083

X-original-commit: e7a43655448db161150d0c62efa14c54ade0a2f6
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-11-20 12:02:24 +00:00
svs-odoo 3c3620be75 [FIX] stock: display multi-step for MRP
Before this commit, the warehouse settings for MRP ("Manufacture to
Resupply" and manufacture step) wasn't displayed even if multi-step
rules is enabled until the multi-warehouse is enabled.

task-2376352

closes odoo/odoo#61482

Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-11-13 10:20:28 +00:00
Rémy Voet (ryv) 923a1c3d53 [FIX] mrp: date_planned_start readonly when done
change the unexciting `close` state in `done` in the attrs of
`date_planned_start`

task-2372196
2020-11-10 10:43:48 +00:00