Commit Graph
37 Commits
Author SHA1 Message Date
Cédric Krier 6e3817ba05 Add equivalent domain of SQL constraints
When possible we should also add a domain so the client can provide better
feedback to the user.

Closes #9432
2024-10-27 16:20:45 +01:00
Udo Spallek 8b252472c4 Replace usage of docstring of Model by __string__ attribute
Closes #8402
2024-11-19 10:09:52 +01:00
Cédric Krier 53c042971b Group locations under the first requested location when computing stock quantities
This reduces the number of unnecessary intermediary results.

Closes #8594
2024-10-22 15:04:52 +02:00
Cédric Krier 31d53ba7a5 Reduce access to dictionary keys when computing stock quantities
#8594
2024-10-22 14:59:18 +02:00
Cédric Krier afb909aa41 Fix missing target field in operand of domain 2024-10-28 21:23:57 +01:00
Cédric Krier 0b5d5c2322 Manage to replace products 2024-09-03 12:39:57 +02:00
Cédric Krier 6e798f98fc Test if origin id is greater or equals to 0 before accessing the target record
Closes #13498
2024-09-09 12:46:16 +02:00
Cédric Krier 4a14245e10 Ensure effective date is before or after origin or outcome stock moves
When the source of the move is the same as the destination of its origin or
outcomes, the stock move can not be done before those moves.
When the destination of the move is the same as the source of the its origin
or outcomes, the stock move can not be done after those moves.

Closes #12851
2024-08-26 22:53:34 +02:00
Cédric Krier 2dfc489ea0 Add outcome moves to stock move
It contains the stock moves for which the stock move is the origin.
2024-08-26 22:49:51 +02:00
Cédric Krier a2dfc4455b Refine index definition
- Set low and high cardinality to index usage
- Use Range usage for numerical expression instead of Equality
2024-07-27 18:36:14 +02:00
Cédric Krier d0c5188641 Enforce empty price on stock move when not required
Closes #13382
2024-07-19 13:14:58 +02:00
Cédric Krier 3d9852c008 Set product range index last for stock move
As product clause are reduced ids, they have less chance to be usable than the
date which is often a single value.
2024-06-19 13:23:57 +02:00
Cédric Krier 9a4051ab8c Add company to the stock move indexes
Almost all the queries on stock move filter by company.
2024-06-18 20:33:41 +02:00
Cédric Krier 6d219e96f3 Do not add period query to the union if there is no period
There is no cache record without period so there is no need to add the query
to the UNION.
2024-06-18 20:32:09 +02:00
Cédric Krier e00fd063c5 Reuse simple COALESCE expression to filter moves after stock period
The expression must be the same as the one in the indexes such that the
indexes can be used to directly filter out all the moves before the period.
This restores the original expression that was changed by e4431b79e409 for the
generic move_date. But by design there can not be any assigned move planned
before the closed period.
2024-06-18 20:29:31 +02:00
Cédric Krier ed0b38db47 Add location name fields to move 2024-01-04 10:56:25 +01:00
Cédric Krier a8ee857681 Compute name of the product for stock move
So we can customize the product name to use the customer or supplier name.

Closes #12893
2024-01-04 23:54:49 +01:00
Cédric Krier 970f40f3be Use internal shipment location to compute warehouse of transit stock move
When the location is the transit location, the warehouse to be used is the
warehouse of the corresponding location on the internal shipment.

Closes #12746
2024-01-11 17:09:50 +01:00
Cédric Krier f5fc52577f Use today as planned date for assigned move
The inclusion of the assigned move in the computation must be coherent between
quantity and delta.

Closes #12914
2024-01-09 19:42:05 +01:00
Cédric Krier 5cda753f9f Allow assigned move of 0 quantity using view location and delete them
This is needed to be able to ignore assignation of move from a view location,
and to delete them before all moves are set to done.

Closes #12870
2023-12-26 16:00:06 +01:00
Cédric Krier 2cbc71847b Factorize assign_supplied of Sale to reuse assign_try of Move 2023-12-08 14:00:08 +01:00
Cédric Krier 86c2350271 Add default location property to pick product as fallback 2023-11-21 10:57:38 +01:00
Cédric Krier 7fb5a0c6b8 Do not compute internal quantity for stock move created without product nor unit
Closes #12716
2023-11-06 18:02:23 +01:00
Cédric Krier a20b805f16 Store original planned date of stock move and compute delay 2023-09-10 21:28:51 +02:00
Cédric Krier b0ea6003e9 Fallback to original copied value of assigned stock move
The default values used by 9d4aff3c72e2 to group copy calls may contains keys
that are not in the modified values because of the union.
In order to keep the copy call grouped as much, we just need to fallback to
the original data value for the fields that are not modified.

Closes #12290
2023-09-17 19:55:50 +02:00
Cédric Krier a4cb3f9f61 Normalize Unit of Measure labels
For short label, we only use UoM with an help text showing with capital letter
the meaning of UoM.
2023-08-20 12:17:27 +02:00
Cédric Krier cb08557fad Rename Uom to Unit for move and inventory
Closes #2221
2023-08-22 13:18:33 +02:00
Cédric Krier 301cb13dca Evaluate also parent shipment to make readonly dates and buttons of stock move
Closes #12404
2023-07-23 21:07:34 +02:00
Cédric Krier 7b9a61c624 Add product cost price to move
It is used to store the cost price of the product when the cost price of the
move is not the same.
2023-06-16 13:43:09 +02:00
Cédric Krier b4e809df2a Instantiate transaction only once when computing stock quantity 2023-05-30 13:03:55 +02:00
Cédric Krier 0c9269d6b2 Do not compute stock quantity for user without company
User without company should not see the stock quantity of all the companies
except for root user (as it is used to check for empty location).
2023-05-30 13:02:19 +02:00
Cédric Krier b9c4b8230d Return instance in on_change_with methods 2023-03-26 09:49:00 +02:00
Cédric Krier ac4d4a7fbb Use multivalue API to access product multivalue fields
Closes #7474
2023-03-19 19:57:30 +01:00
Cédric Krier aa941c80a9 Group copy calls when trying to assign stock moves
Close #9802
2023-02-24 09:02:34 +01:00
Cédric Krier 567b504d4c Add stock invert context to compute quantity 2023-02-11 12:36:49 +01:00
Cédric Krier b48e4966d5 Add functions and attribute to handle check access and active records
Closes #11863
2022-12-30 13:56:10 +01:00
Cédric Krier 4de9b6480e Prepare migration to monorepo 2022-12-16 15:33:21 +01:00