-
-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][MIG] product_cost_price_avco_sync: Migration to 16.0 #1877
Open
pedrobaeza
wants to merge
67
commits into
OCA:16.0
Choose a base branch
from
Tecnativa:16.0-mig-product_cost_price_avco_sync
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[16.0][MIG] product_cost_price_avco_sync: Migration to 16.0 #1877
pedrobaeza
wants to merge
67
commits into
OCA:16.0
from
Tecnativa:16.0-mig-product_cost_price_avco_sync
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ith stock move price unit
…lue before BD write.
Currently translated at 100.0% (2 of 2 strings) Translation: stock-logistics-workflow-12.0/stock-logistics-workflow-12.0-product_cost_price_avco_sync Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-12-0/stock-logistics-workflow-12-0-product_cost_price_avco_sync/pt_BR/
… with same product and distinct price are done at same second.
…pdates quantities and amounts TT29454
…necessary with_context
…tory IN OUT moves
… is not previous in moves or manual adjustment
…on as inventory moves
…one if quantity is the same or the move has more than one stock move lines
…r first adjustment input
…negative stock and vacuum with sale return move TT33334
… Float (20,8)" This reverts commit ace19f5
… values to avoid full processing in case remaining_qty contains an insignificant value less than zero
With this dict we are allowed to process some svls before processing the main avoiding do writes on the method. TT44663
- Include context keys for avoiding mail operations overhead.
Currently translated at 100.0% (5 of 5 strings) Translation: stock-logistics-workflow-15.0/stock-logistics-workflow-15.0-product_cost_price_avco_sync Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-product_cost_price_avco_sync/es/
…ctor odoo/odoo@670012a TT49063 TT49064
… costs When a change is made to the quantities of a stock move that is associated with multiple stock valuation layers, including those related to landed costs, the quantity change is being applied to all the lines instead of only to the one related to the material entry. With these changes, we restrict the quantity change solely to the stock valuation layer related to the material entry, preventing the change from being applied to the lines associated with landed costs.
…changes at once The current problem is that when there are crossed changes between products (like in MRP, having changes in components that affect manufactured products), a lot of writes are done, as each product is processed separately, and thus, there can be continuous resync between them. With this new method, we can process the whole sync in one step, blocking it till pending data is processed, avoiding continuos sync triggerings. Main changes: - Extract the processing code corresponding to one SVL to the method `_process_avco_sync_one`. - Include all the state variables - previous_unit_cost, previous_qty, inventory_processed and unit_cost_processed - into a super-structure (called `svls_dic`, which previously holds the SVL values for the product being synchronized). This super-structure is a dictionary having as keys the pair (product, company), and the value another dictionary with such state variables and storing the SVL values in "svls" key. - 2 main loops for iterating in the elements to sync, one for the pair (product, company), and other inside for the SVLs to sync. First `while` loop is driven by these control variables: * index: which position - pair (product, company) - to process * reloop: activated when something is blocking * any_processed: to control if there's no progress in a whole loop The second one uses the value inside "to_sync" key of the super-structure to know which is the SVL to sync currently, and when processed, we dynamically look for the next one. - `_preprocess_main_svl_line` and `_preprocess_rest_svl_to_sync` dissapears in favor of one control method: `_is_avco_sync_processable`, which can return a falsy value if we can't sync that SVL. - We add extra things to sync modifying the super-structure in `_process_avco_sync_one` - add new (product, company) keys or change "to_sync" value -. - All the AVCO sync methods have been converted to private. - The processing of the SVLs previous to the one to sync is done in a light way, but using the same code of `_process_avco_sync_one`. After obtaining the state variables, the SVLs dict is discarded for saving memory. TT50028
For performance reasons, remove all the remaining values stuff, which is only valid for FIFO.
To customize in upper layers.
/ocabot migration product_cost_price_avco_sync |
The migration issue (#1101) has not been updated to reference the current pull request because a previous pull request (#1465) is not closed. |
/ocabot migration product_cost_price_avco_sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supersedes #1465 having the latest commits and refactoring in 15.0
@Tecnativa