Commit Graph
341 Commits
Author SHA1 Message Date
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
Arnold Moyaux 8c8b32e5e4 [FIX] mrp: manufacture user can not record production
Usecase to reproduce:
- Connect with demo user
- Create a MO w/h routing
- Confirm and produce it
- Record the production wizard

Access right error on product.product for field tracking

It happens because the wizard use a related to product.tracking howerver
it is not set as readonly on the view and send to the server as a value
on save. Since it write on a related field it will try to write on the
linked model(product.product).

This commit set the field as readonly so it is not set to the server.
The field is just used inside domain and it is invisible to the user
so it do not modify any behavior.

opw-1918684

closes odoo/odoo#29942
2019-01-04 14:15:35 +00:00
Christophe Simonis 55dafc20f6 [MERGE] forward port branch 11.0 up to 7e5d5045bf 2018-12-11 17:06:48 +01:00
len-odoo 8db7d70776 [FIX] mrp: do not lose done quantities when updating the quantity to do of a MO
Suppose you have a workorder to create n units of product P,
using raw material R (suppose we use one for one, the following can be extended
to any number of raw materials and factors in a straightforward manner).

Produce j < n units of P. Next, update the quantity to produce to j < k < n.
Since any number m of units between j and n may already have been reserved,
in particular values such that m > k, the move will unreserve the material R.
However, while doing so it will unlink the move_lines, and lose the
quantity_done (j).
The newly created move lines have a quantity_done of zero by default.

Therefore, we store in a dictionary the quantities done for each move line,
and reset these values once the unreservation/reservation of k units is done.

opw 1911969

closes odoo/odoo#28990
2018-11-26 12:56:23 +00:00
Christophe Simonis cf52a04979 [MERGE] forward port branch saas-12.1 up to d3b8422c9c
closes odoo/odoo#30614
2019-01-28 13:58:11 +00:00
Christophe Simonis a337b9ec92 [MERGE] forward port branch 12.0 up to f854e01a98 2019-01-18 14:26:33 +01:00
Christophe Simonis 8aa8548d8a [MERGE] forward port branch 12.0 up to 3e4138deaa
closes odoo/odoo#30045
2019-01-09 15:56:53 +00:00
Christophe Simonis 3e4138deaa [MERGE] forward port branch saas-11.3 up to 2d824a5b7a 2019-01-08 17:08:48 +01:00
Arnold Moyaux e44040cd77 [FIX] mrp: generate lot remove qty reserved/to consumer
commit e1e0826eee introduced a button in
order to quickly add a lot number on the current production. However on
the produce wizard it will create the lot, save the wizard with the new
lot and reopen its view in edit mode. However the qty to consume and
reserved on the produce lines are readonly thus not saved and lost
during the process.

This commit add force-save on the qty to consume and reserved

closes odoo/odoo#29925
2019-01-04 09:42:28 +00:00