-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] account_move_line_product_category
- Loading branch information
1 parent
a4b9c34
commit c340b27
Showing
8 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg | ||
:target: https://www.gnu.org/licenses/agpl-3.0.html | ||
:alt: License: AGPL-3 | ||
|
||
================================== | ||
Account Move Line Product Category | ||
================================== | ||
|
||
Overview | ||
======== | ||
|
||
The **Account Move Line Product Category** module adds the product category field to invoice lines, allowing users to easily view and filter by product categories in the invoice line pivot views. This provides better insight into sales and accounting data, especially when analyzing performance by product categories. | ||
|
||
Features | ||
======== | ||
|
||
- **Product Category Field**: Adds the product category field to invoice lines, which is automatically related to the product's category. | ||
- **Enhanced Pivot Views**: The product category field is available in pivot views for better reporting and analysis. | ||
|
||
Usage | ||
===== | ||
|
||
1. **Install the Module**: | ||
|
||
- Install the module via Odoo's Apps interface. | ||
|
||
2. **Viewing Product Category on Invoice Lines**: | ||
|
||
- Navigate to **Accounting > Customers > Invoices**. | ||
- Open an invoice and view the **Product Category** field in the line items. | ||
|
||
3. **Reporting**: | ||
|
||
- In the pivot view of invoice lines, you can now group or filter data by **Product Category** to analyze sales performance by category. | ||
|
||
Configuration | ||
============= | ||
|
||
No additional configuration is required. The product category field is automatically populated from the related product's category. | ||
|
||
Testing | ||
======= | ||
|
||
Test the following scenarios: | ||
|
||
- **Product Category on Invoice Lines**: | ||
|
||
- Create an invoice with products that belong to different categories. | ||
- Verify that the **Product Category** field is correctly displayed and populated for each product in the invoice lines. | ||
|
||
- **Pivot View**: | ||
|
||
- Go to the pivot view of invoice lines and confirm that the **Product Category** field is available for grouping and filtering data. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
If you encounter any issues, please report them on the GitHub repository at `GitHub Issues <https://github.com/avanzosc/odoo-addons/issues>`_. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Unai Beristain <[email protected]> | ||
* Ana Juaristi <[email protected]> | ||
|
||
For module-specific questions, please contact the contributors directly. Support requests should be made through the official channels. | ||
|
||
License | ||
======= | ||
|
||
This project is licensed under the AGPL-3 License. For more details, please refer to the LICENSE file or visit <https://www.gnu.org/licenses/agpl-3.0.html>. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "Account Move Line Product Category>", | ||
"version": "14.0.1.0.0", | ||
"summary": "Adds product category and manufacturer fields" | ||
"to invoice lines pivot views.", | ||
"category": "Accounting", | ||
"author": "Avanzosc", | ||
"website": "https://github.com/avanzosc/odoo-addons", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"account", | ||
"product", | ||
], | ||
"data": [ | ||
"views/account_move_line_views.xml", | ||
], | ||
"installable": True, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import account_move_line |
11 changes: 11 additions & 0 deletions
11
account_move_line_product_category/models/account_move_line.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class AccountMoveLine(models.Model): | ||
_inherit = "account.move.line" | ||
|
||
product_category_id = fields.Many2one( | ||
related="product_id.categ_id", | ||
string="Product Category", | ||
store=True, | ||
) |
15 changes: 15 additions & 0 deletions
15
account_move_line_product_category/views/account_move_line_views.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="view_move_line_tree_inherit" model="ir.ui.view"> | ||
<field | ||
name="name" | ||
>account.move.line.tree.inherit.product.category.manufacturer</field> | ||
<field name="model">account.move.line</field> | ||
<field name="inherit_id" ref="account.view_move_line_tree" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//tree" position="inside"> | ||
<field name="product_category_id" optional="show" /> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/account_move_line_product_category/odoo/addons/account_move_line_product_category
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../account_move_line_product_category |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |