Commit Graph
251 Commits
Author SHA1 Message Date
Cédric Krier 78bcc4cdc0 Ensure to select period from the right company
As the selection is explicit, we remove also the usage of the rule on stock
move by an explicit clause on company.

issue8718
review258281002
2019-10-16 21:27:48 +02:00
Cédric Krier a99477ac15 Improve selection of moves used for cost
issue8700
review282201004
2019-10-14 00:04:14 +02:00
Cédric Krier 1babe42799 Add visual context on tree view
issue8562
review261951002
2019-09-20 11:47:15 +02:00
Cédric Krier 45a8c87208 Prevent assign unknown attributes on Model
by adding __slots__ on PoolMeta

issue8567
review254091002
2019-09-07 23:45:08 +02:00
Cédric Krier 73e16504dc Allow move as move's origin
issue8253
review269251028
2019-07-08 17:18:14 +02:00
Cédric Krier 08e5893595 Don't set default unit price on stock move
issue8119
review255251002
2019-04-23 09:10:22 +02:00
Cédric Krier c59c13a590 Prefer to pick product from the source location
In order to implement this behavior, we move first the source location in the
quantities to pick.

issue8076
review68471002
2019-03-02 23:04:35 +01:00
Cédric Krier e8e7cc1495 Do not put view location in quantities to pick
There are by design no product to pick there.

issue8077
review47801002
2019-03-02 22:59:03 +01:00
Cédric Krier e3b6c3559d Do not pick product at the destination location
It is forbidden to create move with the same source and destination locations.
To avoid this case, we remove the destination location from the quantities to
pick.

issue7856
review66541002
2019-02-18 18:34:32 +01:00
Cédric Krier a67d1952a7 Add ir.message and use custom exceptions
issue3672
2018-12-29 14:20:29 +01:00
Sergio Morillo 191b26972d Avoid duplicate column names in compute quantity when grouping with existing columns
issue7916
review53491002
2018-12-22 18:16:57 +01:00
David Harper 93f3022413 Add help text
issue6401
review34861002
2018-12-04 12:25:45 +01:00
Cédric Krier 194cf8f97b Use int and Decimal instead of lambda
issue7816
review74401002
2018-10-31 18:17:35 +01:00
Cédric Krier 03ddb0f77b Prevent create move at the closed period date
The value stored in a period are at the date so it should be forbidden to
create move ate this date and we can use the value up to this date.

issue7489
review45721002
2018-09-17 17:47:56 +02:00
Cédric Krier 31f96f8c38 Remove migration before 3.0
issue6470
review52421002
2018-08-09 20:43:51 +02:00
Cédric Krier 973dd92330 Add __table_handler__ to ModelSQL
issue7581
review48531002
2018-07-24 22:01:08 +02:00
Cédric Krier d8aaad50dc Add index on move for join on period
issue7342
review51441002
2018-07-24 19:27:45 +02:00
Cédric Krier 5061618d5b Remove support for Python 2.7
issue7497
review53261002
2018-06-26 19:11:55 +02:00
Cédric Krier 64108233a9 Add _stock_move_split in context to copy move for split
issue7152
review36121002
2018-04-09 10:40:13 +02:00
Cédric Krier d2befe114e Do not include flat location children from child_of search
If the flat location children are not explicitly in the requested locations,
they should not be included because the quantity is already included in the
parent location and they will be added twice if a single location is requested
(because of the quick loop).

issue7162
review44871003
2018-04-03 16:40:00 +02:00
Cédric Krier f632a9cc67 Remove product_ids from products_by_location for grouping_filter
issue7141
review44651002
2018-02-28 18:25:18 +01:00
Cédric Krier 88302f5437 Ensure grouping has no duplicate fields
Otherwise it generates ambiguous SQL query.

issue7141
2018-02-21 14:34:58 +01:00
Sergi Almacellas Abellana 94e9d784fb Add depends on Button
issue6919
review40811002
2018-02-19 11:41:53 +01:00
Cédric Krier 55082d76a6 Allow to group per product columns to compute quantity
This is needed to add the quantity relates on the template form.

issue7068
review40031002
2018-02-11 14:38:33 +01:00
Cédric Krier 253a7890d6 Allow to enforce product default UoM category on move
It uses the product_uom_category field which is a Function to allow other
modules to extend the computation to enforce a specific category.

issue6839
review39791002
2017-10-18 14:49:35 +02:00
Cédric Krier 2ad008f490 Add flat children option on location
issue6563
review36391002
2017-09-28 23:42:22 +02:00
Cédric Krier a8f15c8ea7 Fix searcher methods for dot notation
issue6757
review40651002
2017-09-27 18:37:34 +02:00
Cédric Krier 8e5c000f34 Encode move string before hashing it with md5
In Python3 hashlib.md5 requires a bytes instead of str.
2017-09-26 02:07:12 +02:00
Cédric Krier 8fdf25363b Manage negative quantity in cost re-computation the same way as on move
In case of negative quantity, the unit price is used as cost price if it is an
incoming and the cost price is kept if tit is an outgoing.

issue6770
review44311002
2017-09-26 01:36:23 +02:00
Cédric Krier 88b96f2990 Raise a single warning for moves without origin
issue6764
review41551002
2017-09-26 01:31:25 +02:00
Cédric Krier 60108d24cf Allow user to set effective date of the move
issue6764
review41551002
2017-09-26 01:30:42 +02:00
Cédric Krier ef9d0a87da Allow to cancel staging move
issue6708
review44261002
2017-08-28 18:28:27 +02:00
Cédric Krier 6b9a3b1666 Improve performance of average cost price computation
- Save the move state only when a second same products is going to be
  proceeded.
- Write the new cost prices when the moves are saved.
- Use get_multivalue with extensible pattern using explicit company value.
- Rename _update_product_cost_price into _compute_product_cost_price
- Use grouped instances of moves with the right context to avoid to
  instantiate a product on each call to _compute_product_cost_price.

issue6626
review36431002
2017-08-02 23:03:38 +02:00
Cédric Krier 6d28c7e369 Allow to delete staging move
issue6056
review38461002
2017-07-19 00:10:50 +02:00
Cédric Krier 4356a58019 Allow to deactivate only empty locations
issue6590
review37491002
2017-07-12 19:55:02 +02:00
Cédric Krier ced86b3910 Compute average cost with right product quantity
The product quantity must be computed on all storage location but without
childs otherwise the children quantity are added a second time on parent by
Move._get_quantity
To allow this behaviour the Move._get_quantity and Move._search_quantity use
the 'with_childs' context. If the context is not set, the default value will
be False if there are more than one location. This provides a sane default
behaviour because the locations could be children from each others.

issue6627
review35491002
2017-07-12 19:41:52 +02:00
Cédric Krier 998c564806 Evaluate stock quantity after summing the children
The search quantity can not use an having clause because the SQL query does
not sum the children. The evaluation of the domain expression must be done
after.

issue6605
review37501002
2017-07-12 19:29:19 +02:00
Cédric Krier 675a788d03 Remove unused import 2017-07-05 18:29:51 +02:00
Cédric Krier f132407fc0 Move cost price to product level instead of template
issue6515
review41321002
2017-07-05 14:51:50 +02:00
Cédric Krier 522f3938be Require unit price from supplier only to storage
issue6436
review32241002
2017-06-24 10:34:01 +02:00
Cédric Krier 7d5d54ba3d Do not need origin if both types matches
issue6436
review32241002
2017-06-24 10:33:31 +02:00
Cédric Krier 8acd609ec4 Require move assignation also on view location
issue6436
review32241002
2017-06-24 10:30:30 +02:00
Cédric Krier 1e5d079d5c Do not set effective_date on assign
When the effective date is set on assignation, if the move stays in this state
for more than 1 day, it is no more taken into account for stock quantity
computation.
But if the effective date is not set on assign, the stock quantity computation
must always include assigned moves when stock_assign is set with the exception
of delta computation which must always use the effective or planned date.

issue6371
review36261002
2017-03-29 22:44:33 +02:00
Cédric Krier e4cb95cf02 Do not assign consumable on view location
It is not allowed to assign remaining consumable on the current location if
this location is a view because the domain on location field of move does not
allow it.

issue6372
review33981002
2017-03-23 22:45:29 +01:00
Sergi Almacellas Abellana 34073750ed Avoid computation for assign_try with no moves
issue6366
review31201002
2017-03-22 11:14:45 +01:00
Cédric Krier 305cba24ce Select for update moves used to compute assignation
As a concurrent transaction could update a moves after waiting for the release
of the table lock, we must take a lock on each rows used for the computation.

issue6134
review25921002
2017-01-25 23:28:13 +01:00
Cédric Krier 7bc2bf1496 Do not increase available quantity on destination location in assign_try loop
This makes assignation behaves like compute quantity from changeset 056cbb515d4d

issue6100
review33651002
2016-12-30 22:07:19 +01:00
Cédric Krier 8db7d9bcdb Check period closed per company
issue5934
review30611002
2016-10-11 18:10:02 +02:00
Albert Cervera i Areny 2d34ff6cfd Allow using view locations in cancelled stock moves.
Since changest 29ab3d9bd918 we allow using view locations in draft and staging
moves making it possible to have a warehouse with a view location as main
storage location. But if the user wanted to cancel a shipment with such location
she would have to change the location of all moves before cancelling which is
very annoying.

issue5891
review29531002
2016-10-02 11:00:17 +02:00
Sergi Almacellas Abellana 82be44e56e Fix antipatern of create/write in loop
issue3516
review6891002
2016-06-23 09:40:00 +02:00