Browse Source

[IMP] pos_order_remove_line: black, isort, prettier

pull/495/head
Joan 5 years ago
parent
commit
3e8dd0fbfc
  1. 24
      pos_order_remove_line/__manifest__.py
  2. 11
      pos_order_remove_line/static/src/js/order_line.js
  3. 1
      pos_order_remove_line/static/src/xml/order_line.xml
  4. 15
      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) # 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"], "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"],
} }

11
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) * 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"; "use strict";
require('point_of_sale.screens').OrderWidget.include({
require("point_of_sale.screens").OrderWidget.include({
render_orderline: function() { render_orderline: function() {
var node = this._super.apply(this, arguments); 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; return node;
}, },
remove_line: function(ev) { remove_line: function(ev) {
ev.delegateTarget.parentElement.orderline.set_quantity('remove');
ev.delegateTarget.parentElement.orderline.set_quantity("remove");
}, },
}); });
}); });

1
pos_order_remove_line/static/src/xml/order_line.xml

@ -2,7 +2,6 @@
~ Copyright 2019 LevelPrime ~ Copyright 2019 LevelPrime
~ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) ~ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
--> -->
<templates id="template" xml:space="preserve"> <templates id="template" xml:space="preserve">
<t t-extend="Orderline"> <t t-extend="Orderline">
<t t-jquery=".price" t-operation="before"> <t t-jquery=".price" t-operation="before">

15
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 ~ Copyright 2019 LevelPrime
~ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) ~ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
--> -->
<odoo> <odoo>
<template id="assets" inherit_id="point_of_sale.assets"> <template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside"> <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> </xpath>
</template> </template>
</odoo> </odoo>
Loading…
Cancel
Save