mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[IMP] website_rma: black, isort, prettier
This commit is contained in:
committed by
Nikolaus Weingartmair
parent
471cca686f
commit
fa076605be
@@ -10,10 +10,7 @@
|
|||||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||||
"maintainers": ["ernestotejeda"],
|
"maintainers": ["ernestotejeda"],
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"depends": [
|
"depends": ["rma", "website_form",],
|
||||||
"rma",
|
|
||||||
"website_form",
|
|
||||||
],
|
|
||||||
"data": [
|
"data": [
|
||||||
"data/ir_model_data.xml",
|
"data/ir_model_data.xml",
|
||||||
"views/assets.xml",
|
"views/assets.xml",
|
||||||
|
|||||||
@@ -1,46 +1,56 @@
|
|||||||
# Copyright 2020 Tecnativa - Ernesto Tejeda
|
# Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.addons.website_form.controllers.main import WebsiteForm
|
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
|
|
||||||
|
from odoo.addons.website_form.controllers.main import WebsiteForm
|
||||||
|
|
||||||
|
|
||||||
class WebsiteForm(WebsiteForm):
|
class WebsiteForm(WebsiteForm):
|
||||||
|
|
||||||
def insert_record(self, request, model, values, custom, meta=None):
|
def insert_record(self, request, model, values, custom, meta=None):
|
||||||
if model.model == 'rma':
|
if model.model == "rma":
|
||||||
values['partner_id'] = request.env.user.partner_id.id
|
values["partner_id"] = request.env.user.partner_id.id
|
||||||
res = super(WebsiteForm, self).insert_record(
|
res = super(WebsiteForm, self).insert_record(
|
||||||
request, model, values, custom, meta)
|
request, model, values, custom, meta
|
||||||
|
)
|
||||||
# Add the customer to the followers, the same as when creating
|
# Add the customer to the followers, the same as when creating
|
||||||
# an RMA from a sales order in the portal.
|
# an RMA from a sales order in the portal.
|
||||||
rma = request.env['rma'].browse(res).sudo()
|
rma = request.env["rma"].browse(res).sudo()
|
||||||
rma.message_subscribe([rma.partner_id.id])
|
rma.message_subscribe([rma.partner_id.id])
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
class WebsiteRMA(http.Controller):
|
class WebsiteRMA(http.Controller):
|
||||||
|
|
||||||
def _get_website_rma_product_domain(self, q):
|
def _get_website_rma_product_domain(self, q):
|
||||||
"""Domain used for the products to be shown in selection of
|
"""Domain used for the products to be shown in selection of
|
||||||
the web form.
|
the web form.
|
||||||
"""
|
"""
|
||||||
return [
|
return [
|
||||||
('name', '=ilike', "%{}%".format(q or '')),
|
("name", "=ilike", "%{}%".format(q or "")),
|
||||||
("sale_ok", "=", True),
|
("sale_ok", "=", True),
|
||||||
]
|
]
|
||||||
|
|
||||||
@http.route(['/requestrma'], type='http', auth="user", website=True)
|
@http.route(["/requestrma"], type="http", auth="user", website=True)
|
||||||
def request_rma(self, **kw):
|
def request_rma(self, **kw):
|
||||||
return http.request.render("website_rma.request_rma", {})
|
return http.request.render("website_rma.request_rma", {})
|
||||||
|
|
||||||
@http.route('/website_rma/get_products', type='http', auth="user",
|
@http.route(
|
||||||
methods=['GET'], website=True)
|
"/website_rma/get_products",
|
||||||
def rma_product_read(self, q='', l=25, **post):
|
type="http",
|
||||||
data = request.env['product.product'].sudo().search_read(
|
auth="user",
|
||||||
domain=self._get_website_rma_product_domain(q),
|
methods=["GET"],
|
||||||
fields=['id', 'display_name', 'uom_id'],
|
website=True,
|
||||||
limit=int(l),
|
)
|
||||||
|
def rma_product_read(self, q="", l=25, **post):
|
||||||
|
data = (
|
||||||
|
request.env["product.product"]
|
||||||
|
.sudo()
|
||||||
|
.search_read(
|
||||||
|
domain=self._get_website_rma_product_domain(q),
|
||||||
|
fields=["id", "display_name", "uom_id"],
|
||||||
|
limit=int(l),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
return json.dumps(data)
|
return json.dumps(data)
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="rma.model_rma" model="ir.model">
|
<record id="rma.model_rma" model="ir.model">
|
||||||
<field name="website_form_default_field_id" ref="rma.field_rma__description" />
|
<field
|
||||||
|
name="website_form_default_field_id"
|
||||||
|
ref="rma.field_rma__description"
|
||||||
|
/>
|
||||||
<field name="website_form_access">True</field>
|
<field name="website_form_access">True</field>
|
||||||
<field name="website_form_label">Request RMA</field>
|
<field name="website_form_label">Request RMA</field>
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</data>
|
||||||
<function model="ir.model.fields" name="formbuilder_whitelist">
|
<function model="ir.model.fields" name="formbuilder_whitelist">
|
||||||
<value>rma</value>
|
<value>rma</value>
|
||||||
<value eval="[
|
<value
|
||||||
|
eval="[
|
||||||
'partner_id',
|
'partner_id',
|
||||||
'product_id',
|
'product_id',
|
||||||
'product_uom_qty',
|
'product_uom_qty',
|
||||||
@@ -19,6 +23,7 @@
|
|||||||
'operation_id',
|
'operation_id',
|
||||||
'description',
|
'description',
|
||||||
'state',
|
'state',
|
||||||
]"/>
|
]"
|
||||||
|
/>
|
||||||
</function>
|
</function>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="request_rma_thanks_page" model="website.page">
|
<record id="request_rma_thanks_page" model="website.page">
|
||||||
<field name="url">/requestrma-thank-you</field>
|
<field name="url">/requestrma-thank-you</field>
|
||||||
<field name="website_indexed" eval="False"/>
|
<field name="website_indexed" eval="False" />
|
||||||
<field name="website_published">True</field>
|
<field name="website_published">True</field>
|
||||||
<field name="view_id" ref="request_rma_thanks_page_view"/>
|
<field name="view_id" ref="request_rma_thanks_page_view" />
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from odoo import api, models
|
|||||||
|
|
||||||
|
|
||||||
class IrModel(models.Model):
|
class IrModel(models.Model):
|
||||||
_inherit = 'ir.model'
|
_inherit = "ir.model"
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def get_authorized_fields(self, model_name):
|
def get_authorized_fields(self, model_name):
|
||||||
@@ -17,7 +17,7 @@ class IrModel(models.Model):
|
|||||||
readonly always.
|
readonly always.
|
||||||
"""
|
"""
|
||||||
res = super().get_authorized_fields(model_name)
|
res = super().get_authorized_fields(model_name)
|
||||||
if model_name == 'rma':
|
if model_name == "rma":
|
||||||
auth_fields = ['product_uom_qty', 'product_uom', 'partner_id']
|
auth_fields = ["product_uom_qty", "product_uom", "partner_id"]
|
||||||
res.update(self.env[model_name].fields_get(auth_fields))
|
res.update(self.env[model_name].fields_get(auth_fields))
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
/* Copyright 2020 Tecnativa - Ernesto Tejeda
|
/* Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
/* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
/* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
*/
|
*/
|
||||||
odoo.define('website_rma.website_rma', function(require) {
|
odoo.define("website_rma.website_rma", function(require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
require('web.dom_ready');
|
require("web.dom_ready");
|
||||||
|
|
||||||
$("#rma_request_form input[name='product_id']").select2({
|
$("#rma_request_form input[name='product_id']").select2({
|
||||||
width: '100%',
|
width: "100%",
|
||||||
placeholder: 'Select a product',
|
placeholder: "Select a product",
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
selection_data: false,
|
selection_data: false,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/website_rma/get_products',
|
url: "/website_rma/get_products",
|
||||||
dataType: 'json',
|
dataType: "json",
|
||||||
data: function(term) {
|
data: function(term) {
|
||||||
return {
|
return {
|
||||||
q: term,
|
q: term,
|
||||||
l: 50
|
l: 50,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
results: function(data) {
|
results: function(data) {
|
||||||
@@ -27,18 +27,18 @@ odoo.define('website_rma.website_rma', function(require) {
|
|||||||
id: x.id,
|
id: x.id,
|
||||||
text: x.display_name,
|
text: x.display_name,
|
||||||
uom_id: x.uom_id[0],
|
uom_id: x.uom_id[0],
|
||||||
uom_name: x.uom_id[1]
|
uom_name: x.uom_id[1],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return {results: res};
|
return {results: res};
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// Set UoM on selected onchange
|
// Set UoM on selected onchange
|
||||||
$("#rma_request_form input[name='product_id']").change(function(){
|
$("#rma_request_form input[name='product_id']").change(function() {
|
||||||
var select2_data = $(this).select2('data');
|
var select2_data = $(this).select2("data");
|
||||||
var uom_id = select2_data ? select2_data['uom_id'] : ''
|
var uom_id = select2_data ? select2_data.uom_id : "";
|
||||||
var uom_name = select2_data ? select2_data['uom_name'] : ''
|
var uom_name = select2_data ? select2_data.uom_name : "";
|
||||||
$("input[name='product_uom']").val(uom_id);
|
$("input[name='product_uom']").val(uom_id);
|
||||||
$("input[name='product_uom_name']").val(uom_name);
|
$("input[name='product_uom_name']").val(uom_name);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
/* Copyright 2020 Tecnativa - Ernesto Tejeda
|
/* Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
/* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
/* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
*/
|
*/
|
||||||
odoo.define('website_sale_vat_required.tour', function(require) {
|
odoo.define("website_sale_vat_required.tour", function(require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var tour = require("web_tour.tour");
|
var tour = require("web_tour.tour");
|
||||||
var base = require("web_editor.base");
|
var base = require("web_editor.base");
|
||||||
|
|
||||||
tour.register("request_rma",
|
tour.register(
|
||||||
|
"request_rma",
|
||||||
{
|
{
|
||||||
test: true,
|
test: true,
|
||||||
url: "/my",
|
url: "/my",
|
||||||
wait_for: base.ready()
|
wait_for: base.ready(),
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -19,27 +20,29 @@ odoo.define('website_sale_vat_required.tour', function(require) {
|
|||||||
trigger: ".o_portal_my_home a[href='/requestrma']",
|
trigger: ".o_portal_my_home a[href='/requestrma']",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content: 'Click on request button with the form empty',
|
content: "Click on request button with the form empty",
|
||||||
trigger: "a.o_website_form_send",
|
trigger: "a.o_website_form_send",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content: 'Fill form',
|
content: "Fill form",
|
||||||
trigger: "#rma_request_form",
|
trigger: "#rma_request_form",
|
||||||
extra_trigger: "#rma_request_form",
|
extra_trigger: "#rma_request_form",
|
||||||
run: function (actions) {
|
run: function(actions) {
|
||||||
$("select[name='operation_id'] > option:eq(1)").prop('selected', true);
|
$("select[name='operation_id'] > option:eq(1)").prop(
|
||||||
|
"selected",
|
||||||
|
true
|
||||||
|
);
|
||||||
$("textarea[name='description']").val("RMA test from website form");
|
$("textarea[name='description']").val("RMA test from website form");
|
||||||
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content: 'Click on request button with the form empty',
|
content: "Click on request button with the form empty",
|
||||||
trigger: "a.o_website_form_send",
|
trigger: "a.o_website_form_send",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content: "Click on RMA form page link",
|
content: "Click on RMA form page link",
|
||||||
trigger: "div#request_rma_thanks",
|
trigger: "div#request_rma_thanks",
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,25 +5,24 @@ from odoo.tests.common import Form, HttpCase
|
|||||||
|
|
||||||
|
|
||||||
class TestWebsiteRma(HttpCase):
|
class TestWebsiteRma(HttpCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.product = self.env['product.product'].create({
|
self.product = self.env["product.product"].create(
|
||||||
'name': 'Website rma 1',
|
{"name": "Website rma 1", "type": "product",}
|
||||||
'type': 'product',
|
)
|
||||||
})
|
picking_type = self.env["stock.picking.type"].search(
|
||||||
picking_type = self.env['stock.picking.type'].search(
|
|
||||||
[
|
[
|
||||||
('code', '=', 'outgoing'),
|
("code", "=", "outgoing"),
|
||||||
'|',
|
"|",
|
||||||
('warehouse_id.company_id', '=', self.env.user.company_id.id),
|
("warehouse_id.company_id", "=", self.env.user.company_id.id),
|
||||||
('warehouse_id', '=', False)
|
("warehouse_id", "=", False),
|
||||||
],
|
],
|
||||||
limit=1,
|
limit=1,
|
||||||
)
|
)
|
||||||
picking_form = Form(
|
picking_form = Form(
|
||||||
recordp=self.env['stock.picking'].with_context(
|
recordp=self.env["stock.picking"].with_context(
|
||||||
default_picking_type_id=picking_type.id),
|
default_picking_type_id=picking_type.id
|
||||||
|
),
|
||||||
view="stock.view_picking_form",
|
view="stock.view_picking_form",
|
||||||
)
|
)
|
||||||
picking_form.partner_id = self.env.user.partner_id
|
picking_form.partner_id = self.env.user.partner_id
|
||||||
@@ -38,14 +37,14 @@ class TestWebsiteRma(HttpCase):
|
|||||||
def test_website_form_request_rma(self):
|
def test_website_form_request_rma(self):
|
||||||
self.browser_js(
|
self.browser_js(
|
||||||
url_path="/my",
|
url_path="/my",
|
||||||
code="odoo.__DEBUG__.services['web_tour.tour']"
|
code="odoo.__DEBUG__.services['web_tour.tour']" ".run('request_rma')",
|
||||||
".run('request_rma')",
|
ready="odoo.__DEBUG__.services['web_tour.tour']" ".tours.request_rma.ready",
|
||||||
ready="odoo.__DEBUG__.services['web_tour.tour']"
|
|
||||||
".tours.request_rma.ready",
|
|
||||||
login="admin",
|
login="admin",
|
||||||
)
|
)
|
||||||
rma = self.env['rma'].search([
|
rma = self.env["rma"].search(
|
||||||
('operation_id', '!=', False),
|
[
|
||||||
('description', '=', "RMA test from website form"),
|
("operation_id", "!=", False),
|
||||||
])
|
("description", "=", "RMA test from website form"),
|
||||||
|
]
|
||||||
|
)
|
||||||
self.assertTrue(bool(rma))
|
self.assertTrue(bool(rma))
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
<template id="website_rma_assets_frontend" inherit_id="website.assets_frontend">
|
<template id="website_rma_assets_frontend" inherit_id="website.assets_frontend">
|
||||||
<xpath expr="script[last()]" position="after">
|
<xpath expr="script[last()]" position="after">
|
||||||
<script type="text/javascript" src="/website_rma/static/src/js/website_rma.tour.js"></script>
|
<script
|
||||||
<script type="text/javascript" src="/website_rma/static/src/js/website_rma.js"></script>
|
type="text/javascript"
|
||||||
|
src="/website_rma/static/src/js/website_rma.tour.js"
|
||||||
|
/>
|
||||||
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="/website_rma/static/src/js/website_rma.js"
|
||||||
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<template id="request_rma" name="Request RMA">
|
<template id="request_rma" name="Request RMA">
|
||||||
<t t-call="website.layout">
|
<t t-call="website.layout">
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<div class="oe_structure mt-2" id="oe_structure_website_rma_form_request_0"/>
|
<div
|
||||||
|
class="oe_structure mt-2"
|
||||||
|
id="oe_structure_website_rma_form_request_0"
|
||||||
|
/>
|
||||||
<section class="pt8 pb8">
|
<section class="pt8 pb8">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row s_nb_column_fixed">
|
<div class="row s_nb_column_fixed">
|
||||||
@@ -19,7 +21,10 @@
|
|||||||
<div class="container mt-2">
|
<div class="container mt-2">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<div class="oe_structure mt-2" id="oe_structure_website_rma_form_request_1"/>
|
<div
|
||||||
|
class="oe_structure mt-2"
|
||||||
|
id="oe_structure_website_rma_form_request_1"
|
||||||
|
/>
|
||||||
<section class="s_text_block">
|
<section class="s_text_block">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -32,52 +37,74 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<div class="request_rma_container">
|
<div class="request_rma_container">
|
||||||
<form action="/website_form/"
|
<form
|
||||||
method="post"
|
action="/website_form/"
|
||||||
data-model_name="rma"
|
method="post"
|
||||||
data-success_page="/requestrma-thank-you"
|
data-model_name="rma"
|
||||||
class="s_website_form container-fluid mt32"
|
data-success_page="/requestrma-thank-you"
|
||||||
enctype="multipart/form-data"
|
class="s_website_form container-fluid mt32"
|
||||||
data-editable-form="false"
|
enctype="multipart/form-data"
|
||||||
id="rma_request_form">
|
data-editable-form="false"
|
||||||
|
id="rma_request_form"
|
||||||
|
>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-lg-3 col-md-4 col-form-label"
|
<label
|
||||||
for="product_id">
|
class="col-lg-3 col-md-4 col-form-label"
|
||||||
|
for="product_id"
|
||||||
|
>
|
||||||
Product
|
Product
|
||||||
</label>
|
</label>
|
||||||
<div class="col-lg-7 col-md-8">
|
<div class="col-lg-7 col-md-8">
|
||||||
<input type="hidden"
|
<input
|
||||||
name="product_id"
|
type="hidden"
|
||||||
class="form-control o_website_form_input"/>
|
name="product_id"
|
||||||
|
class="form-control o_website_form_input"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row form-field o_website_form_required">
|
<div
|
||||||
<label class="col-lg-3 col-md-4 col-form-label"
|
class="form-group row form-field o_website_form_required"
|
||||||
for="product_uom_qty">
|
>
|
||||||
|
<label
|
||||||
|
class="col-lg-3 col-md-4 col-form-label"
|
||||||
|
for="product_uom_qty"
|
||||||
|
>
|
||||||
Quantity
|
Quantity
|
||||||
</label>
|
</label>
|
||||||
<div class="col-lg-4 col-md-5">
|
<div class="col-lg-4 col-md-5">
|
||||||
<input class="form-control o_website_form_input"
|
<input
|
||||||
pattern="^\d*(\.\d{0,3})?$"
|
class="form-control o_website_form_input"
|
||||||
name="product_uom_qty"
|
pattern="^\d*(\.\d{0,3})?$"
|
||||||
required=""
|
name="product_uom_qty"
|
||||||
t-att-value="request.params.get('product_uom_qty', '1.000')"/>
|
required=""
|
||||||
|
t-att-value="request.params.get('product_uom_qty', '1.000')"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3">
|
<div class="col-lg-3 col-md-3">
|
||||||
<input type="hidden" name="product_uom"/>
|
<input type="hidden" name="product_uom" />
|
||||||
<input type="text"
|
<input
|
||||||
class="form-control o_website_form_input"
|
type="text"
|
||||||
name="product_uom_name"
|
class="form-control o_website_form_input"
|
||||||
disabled="true"/>
|
name="product_uom_name"
|
||||||
|
disabled="true"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row form-field">
|
<div class="form-group row form-field">
|
||||||
<label class="col-lg-3 col-md-4 col-form-label" for="operation_id">Operation</label>
|
<label
|
||||||
|
class="col-lg-3 col-md-4 col-form-label"
|
||||||
|
for="operation_id"
|
||||||
|
>Operation</label>
|
||||||
<div class="col-lg-7 col-md-8">
|
<div class="col-lg-7 col-md-8">
|
||||||
<select name="operation_id"
|
<select
|
||||||
class="form-control custom-select o_website_form_input">
|
name="operation_id"
|
||||||
<option/>
|
class="form-control custom-select o_website_form_input"
|
||||||
<t t-foreach="request.env['rma.operation'].sudo().search([])" t-as="o">
|
>
|
||||||
|
<option />
|
||||||
|
<t
|
||||||
|
t-foreach="request.env['rma.operation'].sudo().search([])"
|
||||||
|
t-as="o"
|
||||||
|
>
|
||||||
<option t-att-value="o.id">
|
<option t-att-value="o.id">
|
||||||
<t t-esc="o.name" />
|
<t t-esc="o.name" />
|
||||||
</option>
|
</option>
|
||||||
@@ -85,34 +112,56 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row form-field o_website_form_required_custom">
|
<div
|
||||||
<label class="col-lg-3 col-md-4 col-form-label" for="description">Description</label>
|
class="form-group row form-field o_website_form_required_custom"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="col-lg-3 col-md-4 col-form-label"
|
||||||
|
for="description"
|
||||||
|
>Description</label>
|
||||||
<div class="col-lg-7 col-md-8">
|
<div class="col-lg-7 col-md-8">
|
||||||
<textarea class="form-control o_website_form_input"
|
<textarea
|
||||||
name="description"
|
class="form-control o_website_form_input"
|
||||||
required=""><t t-esc="request.params.get('description', '')"/></textarea>
|
name="description"
|
||||||
|
required=""
|
||||||
|
>
|
||||||
|
<t
|
||||||
|
t-esc="request.params.get('description', '')"
|
||||||
|
/>
|
||||||
|
</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="offset-lg-3 offset-md-4 col-md-8 col-lg-7">
|
<div
|
||||||
<a href="#" role="button" class="btn btn-primary btn-lg o_website_form_send">Request</a>
|
class="offset-lg-3 offset-md-4 col-md-8 col-lg-7"
|
||||||
<span id="o_website_form_result"></span>
|
>
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
role="button"
|
||||||
|
class="btn btn-primary btn-lg o_website_form_send"
|
||||||
|
>Request</a>
|
||||||
|
<span id="o_website_form_result" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="oe_structure mt-2" id="oe_structure_website_rma_form_request_2"/>
|
<div
|
||||||
|
class="oe_structure mt-2"
|
||||||
|
id="oe_structure_website_rma_form_request_2"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<t t-call="website.company_description"/>
|
<t t-call="website.company_description" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="oe_structure mt-2" id="oe_structure_website_rma_form_request_3"/>
|
<div
|
||||||
|
class="oe_structure mt-2"
|
||||||
|
id="oe_structure_website_rma_form_request_3"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<record id="request_rma_thanks_page_view" model="ir.ui.view">
|
<record id="request_rma_thanks_page_view" model="ir.ui.view">
|
||||||
<field name="name">Thanks (Request RMA)</field>
|
<field name="name">Thanks (Request RMA)</field>
|
||||||
<field name="type">qweb</field>
|
<field name="type">qweb</field>
|
||||||
@@ -120,27 +169,37 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<t name="Thanks (Request RMA)" t-name="website_crm.requestrma_thanks">
|
<t name="Thanks (Request RMA)" t-name="website_crm.requestrma_thanks">
|
||||||
<t t-call="website.layout">
|
<t t-call="website.layout">
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<div class="oe_structure" id="oe_structure_website_rma_request_rma_thanks_1"/>
|
<div
|
||||||
<div class="container" id="request_rma_thanks">
|
class="oe_structure"
|
||||||
<h1>Thanks!</h1>
|
id="oe_structure_website_rma_request_rma_thanks_1"
|
||||||
<div class="row">
|
/>
|
||||||
<div class="col-lg-8">
|
<div class="container" id="request_rma_thanks">
|
||||||
<div class="alert alert-success" role="status">
|
<h1>Thanks!</h1>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-8">
|
||||||
|
<div class="alert alert-success" role="status">
|
||||||
Your request has been sent successfully.
|
Your request has been sent successfully.
|
||||||
<button type="button" class="close" data-dismiss="alert">&times;</button>
|
<button
|
||||||
|
type="button"
|
||||||
|
class="close"
|
||||||
|
data-dismiss="alert"
|
||||||
|
>&times;</button>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
We will get back to you shortly.
|
We will get back to you shortly.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<t t-call="website.company_description"/>
|
<t t-call="website.company_description" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="oe_structure"
|
||||||
|
id="oe_structure_website_rma_request_rma_thanks_2"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="oe_structure" id="oe_structure_website_rma_request_rma_thanks_2"/>
|
|
||||||
</div>
|
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
<template id="portal_my_home_rma" name="Portal My Home : RMA entries" inherit_id="portal.portal_my_home" priority="30">
|
<template
|
||||||
|
id="portal_my_home_rma"
|
||||||
|
name="Portal My Home : RMA entries"
|
||||||
|
inherit_id="portal.portal_my_home"
|
||||||
|
priority="30"
|
||||||
|
>
|
||||||
<xpath expr="//div[hasclass('o_portal_docs')]" position="after">
|
<xpath expr="//div[hasclass('o_portal_docs')]" position="after">
|
||||||
<div class="oe_structure">
|
<div class="oe_structure">
|
||||||
<section class="s_text_block mt16">
|
<section class="s_text_block mt16">
|
||||||
@@ -10,7 +15,9 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 bg-300">
|
<div class="col-lg-12 bg-300">
|
||||||
<p style="margin-top: 1rem;">
|
<p style="margin-top: 1rem;">
|
||||||
You can request an RMA <strong><a href="/requestrma">here</a></strong> if you do not
|
You can request an RMA <strong>
|
||||||
|
<a href="/requestrma">here</a>
|
||||||
|
</strong> if you do not
|
||||||
know the sales order from which it was made. If you know
|
know the sales order from which it was made. If you know
|
||||||
the sales order, go to it and click on the corresponding button.
|
the sales order, go to it and click on the corresponding button.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,16 +1,25 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
<template id="contact_us_request_rma" name="Request RMA" inherit_id="website.contactus">
|
<template
|
||||||
<xpath expr="//t[@t-call='website.company_description']/../../div[hasclass('col-lg-8')]" position="inside">
|
id="contact_us_request_rma"
|
||||||
|
name="Request RMA"
|
||||||
|
inherit_id="website.contactus"
|
||||||
|
>
|
||||||
|
<xpath
|
||||||
|
expr="//t[@t-call='website.company_description']/../../div[hasclass('col-lg-8')]"
|
||||||
|
position="inside"
|
||||||
|
>
|
||||||
<div class="oe_structure">
|
<div class="oe_structure">
|
||||||
<section class="s_text_block">
|
<section class="s_text_block">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 bg-300">
|
<div class="col-lg-12 bg-300">
|
||||||
<p style="margin-top: 1rem;">
|
<p style="margin-top: 1rem;">
|
||||||
You can request an RMA <strong><a href="/requestrma">here</a></strong> if you do not
|
You can request an RMA <strong>
|
||||||
|
<a href="/requestrma">here</a>
|
||||||
|
</strong> if you do not
|
||||||
know the sales order from which it was made.
|
know the sales order from which it was made.
|
||||||
If you know the sales order, go to it and click on the corresponding button.
|
If you know the sales order, go to it and click on the corresponding button.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user