Commit Graph
349 Commits
Author SHA1 Message Date
William Henrotin 0d73734325 [FIX] mrp: set new initial demand on byproduct
Commit a4c0994 uses variable `qty` as input parameter but override it
at each loop iteration. The original value of `qty` is lost after the
the first pass and so give wrong results for all next iterations.

This commit uses another name to never lose the given value.

closes odoo/odoo#46587

X-original-commit: e1c30bceba6d47d8e087e540f995a02086fa6283
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-02-28 14:51:10 +00:00
Rémy Voet (ryv)andAnkita Raval 8458cc1867 [IMP] stock, mrp, repair: improve the insufficient quantity wizards
Improve the inherited wizards of 'stock.warn.insufficient.qty' by adding
some piece of information about the quantity involved. Also
change titles to integrated the related product into.

task-2144636

Co-authored-by: Ankita Raval <anr@odoo.com>
2020-01-24 10:47:43 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
William Henrotin e1f518bb83 [IMP] mrp: add components in workorders
This commit extend the flexible consumption. On the workorder form view.
It's now possible to add directly new workorder line with any product
(even one not in any BoM line). For those new wo line. A confirmed stock
move is create in the record_production step.

Task : 2082448
2019-11-22 12:39:51 +00:00
William Henrotin 644663eb4a [FIX] mrp: rework of workorder planning
This commit redo the way workorders are planned on their workcenter
calendar. The resource_calendar_leaves introduced in 0679d0d is now linked
to the effetives dates (date_start and date_finished).
The planned dates copy their information onto effective date at the
workorder plannification or any modification before the actual production
(state = draft, pending or ready)

This way, the gantt view and calendar view display either the plannifaction
slot if the production isn't started yet and the effective production
time if it's done. The plannification is also impacted by validating
a production sooner than expected or cancelling it. In the first case,
the date_finished is set at 'now' and in the second case, all the dates
are emptied. The futur workorders will be planned on the newly recover
time slot.

This commit also fix the button_start() method that always rewrite the
date_start even if the production had already been started.

Task : 2082442

closes odoo/odoo#34038

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-10-16 07:34:15 +00:00
William Henrotin e8a3fb9a0b [IMP] mrp: block usage of duplicate serial number
With this commit, the manufacturer will now be noticed earlier in
the process if he produced/consumed a serial number already produced/consumed in a
previous production. Before this commit, an error was triggered as
well but only at the very last step of the production.
This leaded to two issues :
 - The user had to unlock-edit-lock to update the wrong serial number
 - On large production, it was difficult to figure out which was/were
   the product(s) to fix.

The search on previous production is done each time the produce wizard is closed
or once the production is done on a workorder

Task 2002133
2019-10-16 07:34:15 +00:00
William Henrotin bb017e64d4 [FIX] mrp: add new line by the bottom in produce wizard
Any new line (components or by products) in the produce wizard
will be now added from the bottom of the One2many widget.

closes odoo/odoo#37514

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-27 13:03:05 +00:00
Simon Lejeune d6dcbce4fb [FIX] mrp: view mobile friendly
rev [0] was incomplete, the
possible_bom_product_template_attribute_value_ids field was not computed
in mobile because parent_product_tmpl_id was not sent to the server.

rev[1] broke the normal produce wizard

[0] 5d5644c721
[1] 916b49381b

closes odoo/odoo#36595

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-10 08:06:49 +00:00
Simon Lejeune 916b49381b [REF] mrp: produce wizard mobile friendly 2019-09-09 15:17:03 +00:00
Simon Lejeune 96406dc2a9 [REF] mrp: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

Make sure unbuild have proper sequence for each companies.

The produce wizard and workorders company is the one of the production.
The BoM line company_id is the one of its bom_id.
Added some tests.

task-1985992
2019-09-03 15:05:03 +00:00
Raphael Collet 8918bbbb5e [IMP] fields: do not trigger recomputations on transient models from regular models
This is a performance optimization: modifying a regular record will not
trigger some recomputation on a transient record.  Most transient
records are simply waiting to be garbage-collected, so there is no need
to keep their fields up-to-date.

closes odoo/odoo#35909

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-22 10:05:52 +00:00
Arnold Moyaux a3aeabd44d [FIX] mrp: do not base default on active_id
Since active_id do not works allows to use a context
key that will not be modified magically.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 44507c039e [FIX] mrp: change production quantity is wrong on finished moves
Usecase to reproduce:
- BoM -> 1 component for 1 final product
- Create a MO with a quanity of 5
- Update the quantity to 6

-> The move finished has an initial demand of 4
2019-08-19 14:14:13 +00:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
Hetashree Chauhan cdc8bf4bb1 [IMP] mrp, maintenance: back to basics
Modify tree view for MRP Production
Modify form view and tree view for Unbuild orders
Add group by for Bill of Materials
By default show line shart when opening MRP Production report
Modify view for Work Orders
Modify view for Work Centers
Modify view for Routings
Modify view for Maintenance Request
Modify view for Bill of Materials

task-2042304
closes - https://github.com/odoo/odoo/pull/35482
2019-08-14 12:13:27 +00:00
Christophe Simonis b792ba7d9a [MERGE] forward port branch saas-12.3 up to 752b2553c6 2019-08-08 11:52:13 +02:00
Christophe Simonis 7d04dc1c7c [MERGE] forward port branch saas-12.2 up to 9e74730a26 2019-08-06 18:48:24 +02:00
Christophe Simonis 0fadd586fa [MERGE] forward port branch 12.0 up to ff9ddfdacc 2019-08-06 15:57:57 +02:00
Martin Trigaux beba36416f [MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c 2019-07-16 16:36:40 +02:00
Martin Trigaux 40421be73c [MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7
closes odoo/odoo#34907

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 11:44:38 +00:00
Martin Trigaux cf8e74a1a7 [MERGE] Forward port of 12.0 to saas-12.2 up to 1bd434da34
closes odoo/odoo#34901

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 09:14:17 +00:00
Arnold Moyaux ccbd6712f6 [FIX] mrp: MO change the quantity to 0
Usecase to reproduce:
- Create a MO for 5 final units
- Reserve all the components
- Produce 3 units
- Post Inventory (debug mode)
- Edit/Unlock
- Edit a line to consume to an arbitrary amount of quantity
- Change the product qty and set it to 3.

At this point, the reserved quantity and the quantity to consume
still the same than intialy even if the final quantity was updated.

- Mark as done

Then a move is marked as done withtout quantity done and still have
reserved quantity.

It happens because the _update_raw_move function do nothing if the
new quantity to consume is equals to 0.

The arguments returns in _update_raw_move still exists for override
but are not used by the chang_prod_qty method. It's not possible to
cancel the move and then find its parents in order to log the activity.

opw-2023653

closes odoo/odoo#34471

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-15 11:52:47 +00:00
Nans Lefebvre f97b766013 [FIX] mrp: update MO quantity when there are more than one move per line
The production.move_raw_ids usually contains only one move per bom_line_id;
it might not always be the case, as ccbd6712f6 used move[0] to get a singleton.
The following calls to _get_document_iterate_key, _log_activity_get_documents,
also require move to be a singleton, so we use replace move by move[0].

opw 2042099

closes odoo/odoo#35206

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-26 08:28:17 +00:00
Christophe Simonis cf51b5f25d [MERGE] forward port branch saas-12.3 up to 793933a128 2019-06-25 14:23:48 +02:00
Christophe Simonis 78b2063b29 [MERGE] forward port branch saas-12.2 up to 8747d72f1e 2019-06-21 15:16:54 +02:00
Ankita Raval 41870f0000 [IMP] mrp : Crash when products of type service in BoM
Before Commit:
If a product type service in a bom, create a manufacturing order
of product's bom they returns empty recordset because if product
type is not storable and consumable is returns empty object of
stock move else they returns the data dictionary.

After Commit:
If product type service in a bom, create a manufacturing order
we returns the empty dictionary rather than empty object of stock move

Add a testcases
1) to check manufacturing order is generated of product
type of service in bom or not.
2) to check manufacturing order is generate from sale
order of product type sevice in bom or not.

Task ID - 1981790

closes odoo/odoo#33337

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-06-14 14:39:44 +00:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
svs-odoo b499c3308c [IMP] mrp: can delete active MO
Before this commit, you can delete only canceled MO.
Now, if you want to delete a non-canceled MO, it will try to cancel it
then to unlink it.

Task #1969034

closes odoo/odoo#34026

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-31 12:37:39 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Martin Trigaux 5d57e1862f [MERGE] Forward port of saas-12.4 to master up to beba36416f
closes odoo/odoo#34924

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 15:45:24 +00:00
Mitali Patel 9d710df076 [REF] *: use the new decimal precision syntax
Since previous commit moved decimal_precision module's feature into base,
use the new syntax for fields declaration
Remove the imports to the removed module
Remove the module from dependency in manifest

sed -i "s|digits=dp.get_precision('\([A-Z a-z]*\)')|digits='\1'|" **.py
sed -i "/from odoo.tools import decimal_precision as dp/d" **py
2019-07-03 11:16:24 +00:00
William Henrotin 18171b1e52 [FIX] mrp: wrong use of self
The method _workorder_line_ids() is defined on mrp.workorder while `self`
is an instance of change_production_qty wizard in this case. Without this
commit, changing the quantity to produce of a manufactoring order with workorders
already planned raised a traceback.
2019-04-24 14:03:06 +00:00
Christophe Simonis 5548029fb7 [MERGE] forward port branch saas-12.4 up to 5e81b18e24 2019-06-27 20:51:59 +02:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Arnold Moyaux a4c0994cf4 [REF] mrp: byproduct as a workorder line
Technical refactoring in order to set by-products the same way
than raw materials. Before this commit byproduct were always set
at the last workorder or automaticaly set at the end of produce
wizard with the same quantity than in the BoM. In order to modify
it, the user has to produce the finished product then unlock and edit
the finished move line linked to the byproduct. In this commit, the
user could specify at which workorder the byproduct is created and
he could directly specify another quantity done in the produce wizard
inside a specific tab for by-products.

Technicaly, abstract workorder will add a new many2one key on workorder
line in order to set 2 different one2many (one for finished goods and
the other for raw materials). The key is set depending the many2one
key for production on the linked stock move. On the by-products itself,
it is now managed as a workorder line, thus the code to generate them
and transform them in a finished stock move line is the same than for
the raw components.
2019-04-12 12:50:34 +00:00
Arnold Moyaux 5d1e73c5cb [MOV] mrp, mrp_byproduct: move byproduct in mrp
Move code from mrp_byproduct to mrp module. The purpose is to
delete mrp_byproduct module.
2019-04-12 08:46:07 +00:00
William Henrotin 199bb65b42 [IMP] mrp: rename final_lot_id
Commit 5ef46664a2 share code between produce
wizard and workorder. Field final_lot_id is now commonly used but not very
well named. This commit rename it into finished_lot_id as it represent the
lot number of the finished product.

Task : 1998064

closes odoo/odoo#32761

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-27 07:45:07 +00:00
Christophe Simonis e740be208b [FIX] mrp: avoid duplicated labels on mrp.product.produce model
Oversight of previous forward-port.
2019-05-13 16:57:43 +02:00
William Henrotin 108ee65af2 [IMP] mrp: block creating lot from workorder/produce wizard
When registering lot or serial number for a component in a workorder,
the manufacturer can create it on on the fly. We would like to give this
ability a restriction depending on the picking type.
This commit blocks the creating by default but leave the possibility to
tick a new checkbox on the manufacturing picking type to allow the
creation of lot and serial number for components inside the production process.

Task : 1891864
2019-04-04 11:12:29 +00:00
William Henrotin 291eb73ce1 [IMP] mrp: flexible component consumption
Purpose: The quantities to consume on Bill of Material lines should be
either strictly used or be taken as a reference more or less adjustable.

This commit adds a setting on BoM to specify if the consumption is 'strict'
or 'flexible'. This new option has the following impacts:

   On produce wizard: if consumption is set to 'strict', the done quantities
   are prefilled and checked when saving the wizard. If set to 'flexible',
   the production flow remains the same as present one.

   On workorders: if consumption is set to 'strict', the Validate button
   will save the consumed data, and propose to fill the remaining ones until
   the total is registered. If set to 'flexible', two button are displayed.
   'Validate' to register the current component and pass to next step either
   the quantity to consume is complete or not, and 'Continue Consumption'
   to registered the current component quantity but leaving the user the
   possibility to add more quantity (and possibly another lot number) for
   the current component

This commit also revert partially d3617fd852
as the warning become some sort of an error

Task: 1889393
2019-03-27 15:16:55 +00:00
William Henrotin 5ef46664a2 [IMP] mrp: add production lines
To record a production via a manufacturing order, the user can either
use the produce wizard or the workorders views. Those two objects was
technically different but act more or less the same. This commit aims to
merge the similar behaviors in common code

We introduce two new abstract models :
 1. Abstract workorder to share workorders and the produce wizard
 2. Abstract workorder lines to share active_move_line on workorder and
    product_produce_line on the wizard. Those abstract line keep the information
    about the quantities and lot number to put on component move lines and
    finished product move lines

Task : 1891864
2019-02-01 08:13:25 +00:00
Christophe Simonis 4a380414a7 [FIX] mrp: reset lines when quantity change in produce wizard
Error revealed by c6d718f211
2019-05-02 15:36:35 +02:00
Yenthe666 92313e11dc [FIX] mrp: make product_tracking readonly to avoid write operation
closes odoo/odoo#32070

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-03-23 09:46:07 +00:00
Christophe Simonis bd63913326 [MERGE] forward port branch saas-11.3 up to 4e39328a76 2019-03-18 20:03:24 +01:00
Christophe Simonis 9b6e37a983 [MERGE] forward port branch 11.0 up to 7e33b54771 2019-03-18 16:51:57 +01:00
svs-odoo 776cab07d0 [FIX] mrp: tracked products follow putaway strat.
Before this commit, when a product goes from manufacturing order to
location having putaway strategy, if this product is tracked, the
putaway strategy don't apply.

opw-1948514

closes odoo/odoo#31808

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-03-14 15:22:36 +00:00
Nathan de Pryck 5625257991 [FIX] mrp: display quantities with UoM precision in wizard
Before this commit, the fields qty_reserved and
qty_done were displayed in the wizard with a
precision of two digits (for each case).

The problem is that the qty_to consume uses the
precision accuracy defined in 'Product Unit of Measure'.
It resulted that a quantity of 0.002 to consume
was translated to a qty_done of 0.0.

See opw-1949198

closes odoo/odoo#31822

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-14 09:40:38 +00:00
Christophe Simonis 952f784454 [MERGE] forward port branch 11.0 up to 4f2f299534 2019-01-15 17:48:36 +01:00
Christophe Simonis b50883d17b [MERGE] forward port branch 11.0 up to c07b7200b2 2019-01-08 11:52:15 +01:00