Skip to content
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

[15.0][ADD] Product Valuation #1141

Open
wants to merge 27 commits into
base: 15.0
Choose a base branch
from
Open

[15.0][ADD] Product Valuation #1141

wants to merge 27 commits into from

Conversation

dhongu
Copy link
Owner

@dhongu dhongu commented Dec 11, 2023

No description provided.

@dhongu dhongu added the WIP label Dec 11, 2023
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 87 lines in your changes are missing coverage. Please review.

Comparison is base (52d3528) 67.73% compared to head (d36fd09) 67.84%.
Report is 11 commits behind head on 15.0.

❗ Current head d36fd09 differs from pull request most recent head 960ba45. Consider uploading reports for the commit 960ba45 to get more accurate results

Files Patch % Lines
...tatech_stock_valuation/models/product_valuation.py 59.84% 46 Missing and 7 partials ⚠️
...ltatech_stock_valuation/models/product_template.py 29.41% 12 Missing ⚠️
...tatech_stock_valuation/models/account_move_line.py 52.63% 7 Missing and 2 partials ⚠️
...tech_stock_valuation/models/res_config_settings.py 52.94% 8 Missing ⚠️
deltatech_stock_valuation/models/res_company.py 85.00% 1 Missing and 2 partials ⚠️
deltatech_stock_valuation/models/account_move.py 95.00% 0 Missing and 1 partial ⚠️
deltatech_stock_valuation/models/valuation_area.py 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             15.0    #1141      +/-   ##
==========================================
+ Coverage   67.73%   67.84%   +0.11%     
==========================================
  Files         898      910      +12     
  Lines       14672    14905     +233     
  Branches     2348     2371      +23     
==========================================
+ Hits         9938    10113     +175     
- Misses       4029     4079      +50     
- Partials      705      713       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dhongu dhongu changed the title Product Valuation [15.0][ADD] Product Valuation Dec 12, 2023
This update introduces a product valuation history feature, providing a record of past product valuations. This enhancement allows users to review historical valuation data. In addition, corrections were made to several typos, enhancing overall code clarity and maintainability. Notably, the word 'Ammount' was amended to the correct spelling, 'Amount'. Additionally, the 'Year' and 'Month' fields were updated from integer to character type, increasing flexibility for data input.
The code has been updated to include debit and credit fields in both Product Valuation and Product Valuation History. These new fields have been added to the existing views and used to calculate the total amount. Furthermore, a pivot view for the product valuation history has also been established to provide clearer and more robust data analysis.
Added "quantity_in" and "quantity_out" fields to product valuation to distinguish incoming and outgoing stock. They have been integrated into the product valuation view and model for transparency and better tracking of stock changes. The database query in "product_valuation.py" was updated to handle these new fields.
An entry for the 'deltatech_valuation' module has been added to the README.md file in the Odoo addons repository. This module, tagged as 'Product Valuation', is now visible with its version and other details.
The product valuation view and model were updated to include more fields such as "quantity_in", "quantity_out", "debit" and "credit". In addition, several fields in the model's SQL queries and calculation script were revised to better handle the calculations for each valuation. Now, the model can separately track each products' incoming and outgoing quantities and their corresponding debit and credit values.
…uct valuation

The product valuation model has been updated to include initial and final quantity/amount fields. These new fields are considered in all the historical calculations and are also included in the product valuation view. Additionally, a valuation area menu item has been introduced and some instructions have been added to the README file for initial server setup.
Added unique SQL constraints to product valuation and product valuation history to ensure data integrity. Also streamlined SQL queries for generating series and updated quantity and amount initial calculations.
The 'date' field in the product_valuation model was previously optional. This commit changes the 'date' field to be required and indexed, which ensures that every record will have a date, and improves performance when making date-based queries.
The change in the product_valuation.py code imports the relativedelta method from dateutil. This enables the calculation of the last day of the month for a specified date, enhancing the effectiveness of managing product valuation by date.
The refactoring aims to simplify and optimize the product valuation calculations by restructuring the SQL queries. The calculation has been split into smaller, more manageable sub-queries resulting in increased readability and performance. The changes also include better control over data selection and updates for product valuation.
Implemented improvements to SQL code in the product valuation module to enhance its readability and maintainability. The commit simplifies the implementation of an "INSERT INTO" statement and consolidates multiple instances of repetitive code, thereby optimizing the overall codebase without compromising on functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant