Skip to content

Commit 3c447eb

Browse files
[ADD] repair_sale_multi
1 parent 42b916f commit 3c447eb

17 files changed

Lines changed: 766 additions & 0 deletions

repair_sale_multi/README.rst

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
=================
2+
Repair Sale Multi
3+
=================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:9307b36d8ef4b6fe2e8fe3a6d25c99a58b59d15f293577fef1bcfe0048c5e909
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Alpha
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frepair-lightgray.png?logo=github
20+
:target: https://github.com/OCA/repair/tree/18.0/repair_sale_multi
21+
:alt: OCA/repair
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/repair-18-0/repair-18-0-repair_sale_multi
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/repair&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module extends the repair workflow introduced in Odoo 17 by
32+
providing tools to ease the transition to quotation-based invoicing. It
33+
allows users to create a single quotation from multiple repair orders.
34+
35+
.. IMPORTANT::
36+
This is an alpha version, the data model and design can change at any time without warning.
37+
Only for development or testing purpose, do not use in production.
38+
`More details on development status <https://odoo-community.org/page/development-status>`_
39+
40+
**Table of contents**
41+
42+
.. contents::
43+
:local:
44+
45+
Usage
46+
=====
47+
48+
From the repair order list view, select multiple repair orders and use
49+
the **"Create Quotation"** action to generate a new quotation.
50+
51+
Bug Tracker
52+
===========
53+
54+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/repair/issues>`_.
55+
In case of trouble, please check there if your issue has already been reported.
56+
If you spotted it first, help us to smash it by providing a detailed and welcomed
57+
`feedback <https://github.com/OCA/repair/issues/new?body=module:%20repair_sale_multi%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
58+
59+
Do not contact contributors directly about support or help with technical issues.
60+
61+
Credits
62+
=======
63+
64+
Authors
65+
-------
66+
67+
* ForgeFlow
68+
69+
Contributors
70+
------------
71+
72+
- `ForgeFlow <https://forgeflow.com>`__:
73+
74+
- Aaron Henriquez <aaron.henriquez@forgeflow.com>
75+
76+
Maintainers
77+
-----------
78+
79+
This module is maintained by the OCA.
80+
81+
.. image:: https://odoo-community.org/logo.png
82+
:alt: Odoo Community Association
83+
:target: https://odoo-community.org
84+
85+
OCA, or the Odoo Community Association, is a nonprofit organization whose
86+
mission is to support the collaborative development of Odoo features and
87+
promote its widespread use.
88+
89+
.. |maintainer-AaronHForgeFlow| image:: https://github.com/AaronHForgeFlow.png?size=40px
90+
:target: https://github.com/AaronHForgeFlow
91+
:alt: AaronHForgeFlow
92+
93+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
94+
95+
|maintainer-AaronHForgeFlow|
96+
97+
This module is part of the `OCA/repair <https://github.com/OCA/repair/tree/18.0/repair_sale_multi>`_ project on GitHub.
98+
99+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

repair_sale_multi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models, wizards

repair_sale_multi/__manifest__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2025 ForgeFlow S.L.
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3+
4+
{
5+
"name": "Repair Sale Multi",
6+
"version": "18.0.1.0.0",
7+
"author": "ForgeFlow, Odoo Community Association (OCA)",
8+
"website": "https://github.com/OCA/repair",
9+
"summary": "Repair Sale Multi",
10+
"category": "Repair",
11+
"depends": ["repair"],
12+
"data": [
13+
"security/ir.model.access.csv",
14+
"views/repair_order_views.xml",
15+
],
16+
"installable": True,
17+
"development_status": "Alpha",
18+
"license": "AGPL-3",
19+
"maintainers": ["AaronHForgeFlow"],
20+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import repair_order
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright 2025 ForgeFlow S.L.
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3+
from odoo import models
4+
from odoo.exceptions import UserError
5+
from odoo.fields import Command
6+
7+
8+
class RepairOrder(models.Model):
9+
_inherit = "repair.order"
10+
11+
def action_create_combined_sale_order(self):
12+
if not self:
13+
return
14+
# Validate that no repair order is already linked to a sale order
15+
already_linked = self.filtered("sale_order_id")
16+
if already_linked:
17+
ref_str = "\n".join(ro.name for ro in already_linked)
18+
error_msg = f"""You cannot create a quotation for repair "
19+
"orders already linked to a sale order:\n{ref_str}"""
20+
raise UserError(self.env._(error_msg))
21+
picking_types = self.mapped("picking_type_id")
22+
if not picking_types or len(picking_types) != 1:
23+
raise UserError(
24+
self.env._(
25+
"All selected repair orders must have the same picking type."
26+
)
27+
)
28+
29+
partners = self.mapped("partner_id")
30+
if not partners or len(partners) != 1:
31+
raise UserError(
32+
self.env._(
33+
"All selected repair orders must have the same " "customer defined."
34+
)
35+
)
36+
37+
self.env["sale.order"].create(
38+
{
39+
"company_id": self.company_id.id,
40+
"partner_id": partners.id,
41+
"warehouse_id": picking_types.warehouse_id.id,
42+
"repair_order_ids": [Command.link(ro.id) for ro in self],
43+
}
44+
)
45+
# Create the sale order lines from all move_ids
46+
self.mapped("move_ids")._create_repair_sale_order_line()
47+
48+
return self.action_view_sale_order()

repair_sale_multi/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [ForgeFlow](https://forgeflow.com):
2+
3+
> - Aaron Henriquez \<<aaron.henriquez@forgeflow.com>\>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This module extends the repair workflow introduced in Odoo 17 by providing tools to ease the transition to quotation-based invoicing. It allows users to create a single quotation from multiple repair orders.

repair_sale_multi/readme/USAGE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
From the repair order list view, select multiple repair orders and use the **"Create Quotation"** action to generate a new quotation.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2+
access_repair_create_sale_order_wizard,access.repair.create.sale.order.wizard,model_repair_create_sale_order_wizard,sales_team.group_sale_salesman,1,1,1,0

0 commit comments

Comments
 (0)