[IMP] *rma*: Avoid RMAs of kits until rma_mrp is installed

This commit is contained in:
Ernesto Tejeda
2020-12-12 10:18:13 -05:00
parent cca4440cb4
commit 5b741b64b2
2 changed files with 13 additions and 3 deletions

View File

@@ -87,7 +87,9 @@
</thead>
<tbody class="request-rma-tbody">
<t t-foreach="data_list" t-as="data">
<t t-if="data['quantity'] > 0">
<t
t-if="data['quantity'] > 0 and data['picking']"
>
<tr>
<td class="text-left">
<span
@@ -124,7 +126,6 @@
</td>
<td class="text-left">
<span
t-if="data['picking']"
t-esc="data['picking'].name"
/>
<input

View File

@@ -23,10 +23,19 @@ class WebsiteRMA(http.Controller):
"""Domain used for the products to be shown in selection of
the web form.
"""
return [
domain = [
("name", "=ilike", "%{}%".format(q or "")),
("sale_ok", "=", True),
]
# HACK: As there is no glue module for this purpose we have put
# this this condition to check that the mrp module is installed.
if "bom_ids" in request.env["product.product"]._fields:
domain += [
"|",
("bom_ids.type", "!=", "phantom"),
("bom_ids", "=", False),
]
return domain
@http.route(["/requestrma"], type="http", auth="user", website=True)
def request_rma(self, **kw):