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

[16][ADD] rma_category #458

Merged
merged 4 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rma/views/rma_order_line_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
<field name="delivery_policy" />
</group>
<group name="description" string="Description">
<field name="description" nolabel="1" />
<field name="description" nolabel="1" colspan="4" />
</group>
</group>
<notebook>
Expand Down
37 changes: 37 additions & 0 deletions rma_category/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
============
RMA Category
============

This module allow to create categories for RMA and assign these categories to the RMA.
The goal is to be able to classify/organise the RMAs.

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

Bugs are tracked on `GitHub Issues <https://github.com/ForgeFlow/stock-rma/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/ForgeFlow/stock-rma/issues/new?body=module:%20rma%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Akretion

Contributors
~~~~~~~~~~~~

* Florian da Costa <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the ForgeFlow.

This module is part of the `ForgeFlow/stock-rma <https://github.com/ForgeFlow/stock-rma/tree/16.0/rma>`_ project on GitHub.

3 changes: 3 additions & 0 deletions rma_category/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)

from . import models
18 changes: 18 additions & 0 deletions rma_category/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)

{
"name": "RMA Category",
"version": "16.0.1.0.0",
"license": "LGPL-3",
"category": "RMA",
"summary": "Add RMA categories to classify RMAs",
"author": "Akretion,ForgeFlow",
"website": "https://github.com/ForgeFlow/stock-rma",
"depends": ["rma"],
"data": [
"security/ir.model.access.csv",
"views/rma_order_line.xml",
"views/rma_category.xml",
],
"installable": True,
}
2 changes: 2 additions & 0 deletions rma_category/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import rma_category
from . import rma_order_line
22 changes: 22 additions & 0 deletions rma_category/models/rma_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)

from odoo import fields, models


class RmaCategory(models.Model):
_name = "rma.category"
_description = "RMA Cagtegories"
_order = "name"

active = fields.Boolean(
default=True,
help="The active field allows you to hide the category without removing it.",
)
name = fields.Char(
required=True,
copy=False,
)

_sql_constraints = [
("name_uniq", "unique (name)", "Category name already exists !"),
]
9 changes: 9 additions & 0 deletions rma_category/models/rma_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)

from odoo import fields, models


class RmaOrderLine(models.Model):
_inherit = "rma.order.line"

category_ids = fields.Many2many("rma.category", string="Categories")
1 change: 1 addition & 0 deletions rma_category/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Florian da Costa <[email protected]>
2 changes: 2 additions & 0 deletions rma_category/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allow to create categories for RMA and assign these categories to the RMA.
The goal is to be able to classify/organise the RMAs.
4 changes: 4 additions & 0 deletions rma_category/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_rma_category_manager,access.rma.category,model_rma_category,rma.group_rma_manager,1,1,1,1
access_rma_category_customer_user,access.rma.category,model_rma_category,rma.group_rma_customer_user,1,0,0,0
access_rma_category_supplier_user,access.rma.category,model_rma_category,rma.group_rma_supplier_user,1,0,0,0
67 changes: 67 additions & 0 deletions rma_category/views/rma_category.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="rma_category_view_search" model="ir.ui.view">
<field name="name">rma.category.search</field>
<field name="model">rma.category</field>
<field name="arch" type="xml">
<search string="RMA Categories">
<field name="name" />
<filter
string="Archived"
name="inactive"
domain="[('active','=',False)]"
/>
<filter
string="Active"
name="active"
domain="[('active','!=',False)]"
/>
</search>
</field>
</record>
<record id="view_rma_category_form" model="ir.ui.view">
<field name="name">rma.category.form</field>
<field name="model">rma.category</field>
<field name="arch" type="xml">
<form string="RMA Category">
<sheet>
<group>
<field name="name" />
</group>
</sheet>
</form>
</field>
</record>

<record id="view_rma_category_tree" model="ir.ui.view">
<field name="name">rma.category.tree</field>
<field name="model">rma.category</field>
<field eval="6" name="priority" />
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="active" />
</tree>
</field>
</record>

<record id="action_rma_category" model="ir.actions.act_window">
<field name="name">RMA Categories</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">rma.category</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new RMA Category
</p><p>
Manage RMA categories to better classify them for tracking and analysis purposes.
</p>
</field>
</record>

<menuitem
id="rma_configuration_rma_category_menu"
name="RMA Categories"
parent="rma.menu_rma_config"
action="action_rma_category"
/>
</odoo>
18 changes: 18 additions & 0 deletions rma_category/views/rma_order_line.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" ?>
<odoo>
<record id="view_rma_line_form" model="ir.ui.view">
<field name="model">rma.order.line</field>
<field name="inherit_id" ref="rma.view_rma_line_form" />
<field name="arch" type="xml">
<field name="description" position="after">
<field
name="category_ids"
widget="many2many_tags"
options="{'no_create': True}"
placeholder="Categories..."
colspan="4"
/>
</field>
</field>
</record>
</odoo>
1 change: 1 addition & 0 deletions setup/rma_category/odoo/addons/rma_category
6 changes: 6 additions & 0 deletions setup/rma_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,
)
Loading