Browse Source

[IMP] pos_order_remove_line: black, isort, prettier

pull/495/head
Joan 4 years ago
parent
commit
3e8dd0fbfc
  1. 24
      pos_order_remove_line/__manifest__.py
  2. 15
      pos_order_remove_line/static/src/js/order_line.js
  3. 3
      pos_order_remove_line/static/src/xml/order_line.xml
  4. 17
      pos_order_remove_line/views/assets.xml

24
pos_order_remove_line/__manifest__.py

@ -2,19 +2,15 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
'name': "POS Order Remove Line",
'summary': "Add button to remove POS order line.",
'author': "Roberto Fichera, Odoo Community Association (OCA)",
'website': 'https://www.github.com/OCA/pos',
'category': 'Point of Sale',
"name": "POS Order Remove Line",
"summary": "Add button to remove POS order line.",
"author": "Roberto Fichera, Odoo Community Association (OCA)",
"website": "https://www.github.com/OCA/pos",
"category": "Point of Sale",
"maintainers": ["robyf70"],
'version': '12.0.1.0.0',
'license': 'LGPL-3',
'depends': ['point_of_sale'],
'data': [
'views/assets.xml'
],
'qweb': [
'static/src/xml/order_line.xml'
]
"version": "13.0.1.0.0",
"license": "LGPL-3",
"depends": ["point_of_sale"],
"data": ["views/assets.xml"],
"qweb": ["static/src/xml/order_line.xml"],
}

15
pos_order_remove_line/static/src/js/order_line.js

@ -3,20 +3,21 @@
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
*/
odoo.define('pos_order_remove_line.order_line', function (require) {
odoo.define("pos_order_remove_line.order_line", function(require) {
"use strict";
require('point_of_sale.screens').OrderWidget.include({
render_orderline: function () {
require("point_of_sale.screens").OrderWidget.include({
render_orderline: function() {
var node = this._super.apply(this, arguments);
$(node).find('.remove-line-button').on('click', null,
this.remove_line.bind(this));
$(node)
.find(".remove-line-button")
.on("click", null, this.remove_line.bind(this));
return node;
},
remove_line: function (ev) {
ev.delegateTarget.parentElement.orderline.set_quantity('remove');
remove_line: function(ev) {
ev.delegateTarget.parentElement.orderline.set_quantity("remove");
},
});
});

3
pos_order_remove_line/static/src/xml/order_line.xml

@ -2,12 +2,11 @@
~ Copyright 2019 LevelPrime
~ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<templates id="template" xml:space="preserve">
<t t-extend="Orderline">
<t t-jquery=".price" t-operation="before">
<button class="remove-line-button">
<i class="fa fa-trash-o"/>
<i class="fa fa-trash-o" />
</button>
</t>
</t>

17
pos_order_remove_line/views/assets.xml

@ -1,17 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Copyright 2019 LevelPrime
~ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/less" href="/pos_order_remove_line/static/src/less/order_line.less"/>
<script type="text/javascript" src="/pos_order_remove_line/static/src/js/order_line.js"/>
<link
rel="stylesheet"
type="text/less"
href="/pos_order_remove_line/static/src/less/order_line.less"
/>
<script
type="text/javascript"
src="/pos_order_remove_line/static/src/js/order_line.js"
/>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save