Skip to content
Extraits de code Groupes Projets
Valider c0bca632 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[ADD] multi release button

parent b36cfc14
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
"views/menus.xml", "views/menus.xml",
], ],
"assets": { "assets": {
"web.assets_backend": [
"lefilament_release/static/src/js/list_multi_release_button.esm.js",
"lefilament_release/static/src/xml/list_multi_release_button.xml",
],
"web.assets_frontend": ["lefilament_release/static/src/css/portal.css"], "web.assets_frontend": ["lefilament_release/static/src/css/portal.css"],
}, },
"installable": True, "installable": True,
......
import {ListController} from "@web/views/list/list_controller";
import {listView} from "@web/views/list/list_view";
import {registry} from "@web/core/registry";
export class MultiReleaseListController extends ListController {
setup() {
super.setup();
}
onMultiCustomerClick() {
this.actionService.doAction({
type: "ir.actions.act_window",
res_model: "multi.partner.release.wizard",
name: "Saisir pour plusieurs clients",
views: [[false, "form"]],
target: "new",
res_id: false,
});
}
}
registry.category("views").add("list_multi_release_button", {
...listView,
Controller: MultiReleaseListController,
buttonTemplate: "button_multi_release.buttons",
});
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<t
t-name="button_multi_release.buttons"
t-inherit="web.ListView.Buttons"
t-inherit-mode="primary"
>
<xpath expr="//div[hasclass('o_list_buttons')]" position="after">
<button
type="button"
class="btn btn-outline-info"
style="width: 200px;"
tabindex="3"
t-on-click="onMultiCustomerClick"
>
Saisir pour plusieurs clients
</button>
</xpath>
</t>
</odoo>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="header_template" name="lefilament_release.header_template">
<div id="release" style="background-color: #fff; padding: 16px 0">
<div class="container">
<div class="row">
<div class="col-12 text-center">
<div
class="btn-group"
role="group"
aria-label="Releases"
style="padding-top: 5px; padding-bottom: 5px;"
>
<a
type="action"
name="%(lefilament_release.multi_partner_release_wizard_act_window)d"
class="btn btn-outline-info"
style="width: 250px;"
tabindex="4"
>
Saisir pour plusieurs clients
</a>
</div>
</div>
</div>
</div>
</div>
</template>
</odoo>
...@@ -66,10 +66,10 @@ ...@@ -66,10 +66,10 @@
options="{'string': 'Copier le lien'}" options="{'string': 'Copier le lien'}"
/> />
</group> </group>
<hr colspan="12" /> <hr colspan="2" />
<label for="description" class="font-weight-bold" /> <label for="description" class="font-weight-bold" />
<field name="description" /> <field name="description" />
<hr colspan="12" /> <hr colspan="2" />
<label for="release_module_ids" class="font-weight-bold" /> <label for="release_module_ids" class="font-weight-bold" />
<field name="release_module_ids"> <field name="release_module_ids">
<list editable="top"> <list editable="top">
...@@ -93,8 +93,7 @@ ...@@ -93,8 +93,7 @@
<field name="name">res.partner.release.tree</field> <field name="name">res.partner.release.tree</field>
<field name="model">res.partner.release</field> <field name="model">res.partner.release</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<!-- TODO: make JS action to create releases for multiple customers --> <list js_class="list_multi_release_button">
<list>
<field name="release_date" /> <field name="release_date" />
<field name="user_id" /> <field name="user_id" />
<field name="partner_id" /> <field name="partner_id" />
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
/> />
<field name="create_date" string="Créé le" /> <field name="create_date" string="Créé le" />
</group> </group>
<hr /> <hr colspan="2" />
<label for="description" class="font-weight-bold" /> <label for="description" class="font-weight-bold" />
<field name="description" /> <field name="description" />
<hr /> <hr colspan="2" />
<label for="release_module_ids" class="font-weight-bold" /> <label for="release_module_ids" class="font-weight-bold" />
<field name="release_module_ids"> <field name="release_module_ids">
<list editable="top"> <list editable="top">
...@@ -52,13 +52,4 @@ ...@@ -52,13 +52,4 @@
</form> </form>
</field> </field>
</record> </record>
<!-- Action Window -->
<record id="multi_partner_release_wizard_act_window" model="ir.actions.act_window">
<field name="name">Releases Client</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">multi.partner.release.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo> </odoo>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter