diff --git a/rma/README.rst b/rma/README.rst index 788f6684..dea2df0f 100644 --- a/rma/README.rst +++ b/rma/README.rst @@ -89,8 +89,23 @@ An RMA can also be created from a return of a delivery order: Every RMA will be in confirmed state and they will be linked to the returning operation generated previously. -**Note: An RMA can also be created from an incoming email (See configuration -section).** +There are Optional RMA Teams that can be used for: + + - Organize RMAs in sections. + - Subscribe users to notifications. + - Create RMAs from incoming mail to special aliases (See configuration + section). + +To create an RMA Team (RMA Responsible user level required): + + #. Go to *RMA > Configuration > RMA Teams* + #. Create a new team and assign a name, a responsible and members. + #. Subscribe users to notifications, that can be of these subtypes: + + - RMA draft. When a new RMA is created. + - Notes, Debates, Activities. As in standard Odoo. + #. In the list view, use the cross handle to sort RMA Teams. The top team + will be the default one if no team is set. Known issues / Roadmap ====================== diff --git a/rma/models/rma.py b/rma/models/rma.py index b547b3d4..8a9ddcd8 100644 --- a/rma/models/rma.py +++ b/rma/models/rma.py @@ -55,7 +55,6 @@ class Rma(models.Model): comodel_name="res.users", string="Responsible", track_visibility="always", - default=lambda self: self.env.user, states={ 'locked': [('readonly', True)], 'cancelled': [('readonly', True)], @@ -499,6 +498,9 @@ class Rma(models.Model): ir_sequence = ir_sequence.with_context( force_company=vals['company_id']) vals['name'] = ir_sequence.next_by_code('rma') + # Assign a default team_id which will be the first in the sequence + if "team_id" not in vals: + vals["team_id"] = self.env["rma.team"].search([], limit=1).id return super().create(vals) def copy(self, default=None): diff --git a/rma/models/rma_team.py b/rma/models/rma_team.py index 31b60097..018fa882 100644 --- a/rma/models/rma_team.py +++ b/rma/models/rma_team.py @@ -8,8 +8,9 @@ class RmaTeam(models.Model): _name = "rma.team" _inherit = ['mail.alias.mixin', 'mail.thread'] _description = "RMA Team" - _order = "name" + _order = "sequence, name" + sequence = fields.Integer() name = fields.Char( required=True, translate=True, diff --git a/rma/readme/USAGE.rst b/rma/readme/USAGE.rst index 6e6194a9..aa524e7a 100644 --- a/rma/readme/USAGE.rst +++ b/rma/readme/USAGE.rst @@ -33,5 +33,20 @@ An RMA can also be created from a return of a delivery order: Every RMA will be in confirmed state and they will be linked to the returning operation generated previously. -**Note: An RMA can also be created from an incoming email (See configuration -section).** +There are Optional RMA Teams that can be used for: + + - Organize RMAs in sections. + - Subscribe users to notifications. + - Create RMAs from incoming mail to special aliases (See configuration + section). + +To create an RMA Team (RMA Responsible user level required): + + #. Go to *RMA > Configuration > RMA Teams* + #. Create a new team and assign a name, a responsible and members. + #. Subscribe users to notifications, that can be of these subtypes: + + - RMA draft. When a new RMA is created. + - Notes, Debates, Activities. As in standard Odoo. + #. In the list view, use the cross handle to sort RMA Teams. The top team + will be the default one if no team is set. diff --git a/rma/static/description/index.html b/rma/static/description/index.html index a45186e6..88523ce3 100644 --- a/rma/static/description/index.html +++ b/rma/static/description/index.html @@ -440,8 +440,29 @@ stock location and click on ‘Return’ button. Every RMA will be in confirmed state and they will be linked to the returning operation generated previously. -
Note: An RMA can also be created from an incoming email (See configuration -section).
+There are Optional RMA Teams that can be used for:
++++
+- Organize RMAs in sections.
+- Subscribe users to notifications.
+- Create RMAs from incoming mail to special aliases (See configuration +section).
+
To create an RMA Team (RMA Responsible user level required):
+++
+- Go to RMA > Configuration > RMA Teams
+- Create a new team and assign a name, a responsible and members.
+- Subscribe users to notifications, that can be of these subtypes:
++
+- RMA draft. When a new RMA is created.
+- Notes, Debates, Activities. As in standard Odoo.
+- In the list view, use the cross handle to sort RMA Teams. The top team +will be the default one if no team is set.
+