Skip to content

Commit

Permalink
[ADD] account_move_line_product_category
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Oct 10, 2024
1 parent 6d362d0 commit dcb1bb9
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 0 deletions.
42 changes: 42 additions & 0 deletions account_move_line_product_category/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=============================
Account Move Product Category
=============================

This module extends the invoice and sale order line models to include fields for the product's category and manufacturer. It also modifies the pivot views and tree views to show these fields.

Features
--------

- Adds `Product Category` and `Manufacturer` fields to the Account Move Line model.
- Updates the Invoice Line pivot view to include `Product Category` and `Manufacturer` fields.
- Updates the Invoice Line tree view to display `Product Category` and `Manufacturer` fields.

Usage
-----

- Go to Accounting -> Invoices -> Invoice Lines in the backend.
- You will see `Product Category` and `Manufacturer` columns in the invoice line view.

License
-------

This module is licensed under the AGPL-3 License. See `License Information <http://www.gnu.org/licenses/agpl-3.0-standalone.html>`_

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/avanzosc/odoo-addons/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smash it by providing detailed and welcomed feedback.

Credits
=======

Contributors
------------
* Ana Juaristi <anajuaristi@avanzosc.es>
* Unai Beristain <unaiberistain@avanzosc.es>

Do not contact contributors directly about support or help with technical issues.
1 change: 1 addition & 0 deletions account_move_line_product_category/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions account_move_line_product_category/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Account Move 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,
}
1 change: 1 addition & 0 deletions account_move_line_product_category/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move_line
11 changes: 11 additions & 0 deletions account_move_line_product_category/models/account_move_line.py
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,
)
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>
6 changes: 6 additions & 0 deletions setup/account_move_line_product_category/setup.py
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,
)

0 comments on commit dcb1bb9

Please sign in to comment.