Browse Source
[CHG] : Rename README to README.rst (https://github.com/OCA/pos/pull/6#issuecomment-66383621)
[CHG] : Rename README to README.rst (https://github.com/OCA/pos/pull/6#issuecomment-66383621)
[CHG] : Rename module to pos_pricelist instead of the old one [FIX] : Fix typo mentioned on this comments : - https://github.com/OCA/pos/pull/6#discussion_r21574900 - https://github.com/OCA/pos/pull/6#commitcomment-9012800 [IMP] : Recover a missed feature while setting a price for an orderline https://github.com/OCA/pos/pull/6#discussion_r21575474 [IMP] : Switch to while loop while iterating over an array [REM] : Avoid bad practice on Object Class : https://github.com/OCA/pos/pull/6#commitcomment-9012727pull/6/head
Adil Houmadi
10 years ago
11 changed files with 147 additions and 124 deletions
-
27pos_dynamic_price/static/src/js/helper.js
-
20pos_dynamic_price/view/pos_dynamic_price_template.xml
-
6pos_pricelist/README.rst
-
2pos_pricelist/__init__.py
-
10pos_pricelist/__openerp__.py
-
73pos_pricelist/static/src/js/db.js
-
11pos_pricelist/static/src/js/main.js
-
50pos_pricelist/static/src/js/models.js
-
4pos_pricelist/static/src/js/screens.js
-
33pos_pricelist/static/src/js/widgets.js
-
29pos_pricelist/views/pos_pricelist_template.xml
@ -1,27 +0,0 @@ |
|||||
/****************************************************************************** |
|
||||
* Point Of Sale - Dynamic Price for POS Odoo |
|
||||
* Copyright (C) 2014 Taktik (http://www.taktik.be)
|
|
||||
* @author Adil Houmadi <ah@taktik.be> |
|
||||
* |
|
||||
* This program is free software: you can redistribute it and/or modify |
|
||||
* it under the terms of the GNU Affero General Public License as |
|
||||
* published by the Free Software Foundation, either version 3 of the |
|
||||
* License, or (at your option) any later version. |
|
||||
* This program is distributed in the hope that it will be useful, |
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
* GNU Affero General Public License for more details. |
|
||||
* You should have received a copy of the GNU Affero General Public License |
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||
* |
|
||||
******************************************************************************/ |
|
||||
Object.size = function (obj) { |
|
||||
"use strict"; |
|
||||
var size = 0, key; |
|
||||
for (key in obj) { |
|
||||
if (obj.hasOwnProperty(key)) { |
|
||||
size += 1; |
|
||||
} |
|
||||
} |
|
||||
return size; |
|
||||
}; |
|
@ -1,20 +0,0 @@ |
|||||
<openerp> |
|
||||
<data> |
|
||||
<template id="pos_dynamic_price_assets_backend" |
|
||||
name="pos_dynamic_price_assets_backend" |
|
||||
inherit_id="point_of_sale.assets_backend"> |
|
||||
<xpath expr="." position="inside"> |
|
||||
<script src="/pos_dynamic_price/static/src/js/helper.js" |
|
||||
type="text/javascript"></script> |
|
||||
<script src="/pos_dynamic_price/static/src/js/db.js" |
|
||||
type="text/javascript"></script> |
|
||||
<script src="/pos_dynamic_price/static/src/js/models.js" |
|
||||
type="text/javascript"></script> |
|
||||
<script src="/pos_dynamic_price/static/src/js/screens.js" |
|
||||
type="text/javascript"></script> |
|
||||
<script src="/pos_dynamic_price/static/src/js/main.js" |
|
||||
type="text/javascript"></script> |
|
||||
</xpath> |
|
||||
</template> |
|
||||
</data> |
|
||||
</openerp> |
|
@ -1,6 +1,6 @@ |
|||||
# -#- coding: utf-8 -#- |
# -#- coding: utf-8 -#- |
||||
############################################################################## |
############################################################################## |
||||
# Point Of Sale - Dynamic Price for POS Odoo |
|
||||
|
# Point Of Sale - Pricelist for POS Odoo |
||||
# Copyright (C) 2014 Taktik (http://www.taktik.be) |
# Copyright (C) 2014 Taktik (http://www.taktik.be) |
||||
# @author Adil Houmadi <ah@taktik.be> |
# @author Adil Houmadi <ah@taktik.be> |
||||
# |
# |
@ -0,0 +1,33 @@ |
|||||
|
/****************************************************************************** |
||||
|
* Point Of Sale - Pricelist for POS Odoo |
||||
|
* Copyright (C) 2014 Taktik (http://www.taktik.be)
|
||||
|
* @author Adil Houmadi <ah@taktik.be> |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU Affero General Public License as |
||||
|
* published by the Free Software Foundation, either version 3 of the |
||||
|
* License, or (at your option) any later version. |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU Affero General Public License for more details. |
||||
|
* You should have received a copy of the GNU Affero General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
* |
||||
|
******************************************************************************/ |
||||
|
function pos_pricelist_widgets(instance, module) { |
||||
|
|
||||
|
module.OrderWidget = module.OrderWidget.extend({ |
||||
|
set_value: function (val) { |
||||
|
this._super(val); |
||||
|
var order = this.pos.get('selectedOrder'); |
||||
|
if (this.editable && order.getSelectedLine()) { |
||||
|
var mode = this.numpad_state.get('mode'); |
||||
|
if (mode === 'price') { |
||||
|
order.getSelectedLine().set_manuel_price(true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
@ -0,0 +1,29 @@ |
|||||
|
<openerp> |
||||
|
<data> |
||||
|
<template id="pos_pricelist_assets_backend" |
||||
|
name="pos_pricelist_assets_backend" |
||||
|
inherit_id="point_of_sale.assets_backend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<script src="/pos_pricelist/static/src/js/db.js" |
||||
|
type="text/javascript"></script> |
||||
|
<script src="/pos_pricelist/static/src/js/models.js" |
||||
|
type="text/javascript"></script> |
||||
|
<script src="/pos_pricelist/static/src/js/widgets.js" |
||||
|
type="text/javascript"></script> |
||||
|
<script src="/pos_pricelist/static/src/js/screens.js" |
||||
|
type="text/javascript"></script> |
||||
|
<script src="/pos_pricelist/static/src/js/tests.js" |
||||
|
type="text/javascript"></script> |
||||
|
<script src="/pos_pricelist/static/src/js/main.js" |
||||
|
type="text/javascript"></script> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<template id="qunit_suite" name="pos_pricelist_test qunit" inherit_id="web.qunit_suite"> |
||||
|
<xpath expr="//head" position="inside"> |
||||
|
<script type="text/javascript" src="/pos_pricelist/static/test/tests.js"></script> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue