From 74898755c4d97bc8757437ac8616c5ebb2ca942b Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Thu, 3 Dec 2015 16:53:44 +0100 Subject: [PATCH 1/5] [ADD] Add cash deposit modules from launchpad --- pos_cash_deposit/__init__.py | 5 + pos_cash_deposit/__openerp__.py | 22 ++++ .../data/pos_cash_deposit_product.xml | 13 +++ pos_cash_deposit/model/__init__.py | 5 + pos_cash_deposit/model/pos_order.py | 96 +++++++++++++++++ .../static/src/img/close-customer.png | Bin 0 -> 269 bytes .../static/src/js/pos_cash_deposit.js | 7 ++ .../static/src/js/pos_cash_deposit_db.js | 30 ++++++ .../static/src/js/pos_cash_deposit_models.js | 40 +++++++ .../static/src/js/pos_cash_deposit_screen.js | 48 +++++++++ .../static/src/js/pos_cash_deposit_widget.js | 100 ++++++++++++++++++ .../static/src/xml/pos_cash_deposit.xml | 31 ++++++ pos_cash_deposit/view/pos_cash_deposit.xml | 15 +++ pos_pay_invoice/__init__.py | 3 + pos_pay_invoice/__openerp__.py | 22 ++++ .../static/src/css/pos_pay_invoice.css | 30 ++++++ .../static/src/js/pos_pay_invoice.js | 5 + .../static/src/js/pos_pay_invoice_screen.js | 62 +++++++++++ .../static/src/js/pos_pay_invoice_widget.js | 99 +++++++++++++++++ .../static/src/xml/pos_pay_invoice.xml | 82 ++++++++++++++ pos_pay_invoice/view/pos_pay_invoice.xml | 18 ++++ pos_pay_sale_order/__init__.py | 3 + pos_pay_sale_order/__openerp__.py | 22 ++++ .../static/src/css/pos_pay_sale_order.css | 30 ++++++ .../static/src/js/pos_pay_sale_order.js | 5 + .../src/js/pos_pay_sale_order_screen.js | 63 +++++++++++ .../src/js/pos_pay_sale_order_widget.js | 96 +++++++++++++++++ .../static/src/xml/pos_pay_sale_order.xml | 75 +++++++++++++ .../view/pos_pay_sale_order.xml | 19 ++++ 29 files changed, 1046 insertions(+) create mode 100644 pos_cash_deposit/__init__.py create mode 100644 pos_cash_deposit/__openerp__.py create mode 100644 pos_cash_deposit/data/pos_cash_deposit_product.xml create mode 100644 pos_cash_deposit/model/__init__.py create mode 100644 pos_cash_deposit/model/pos_order.py create mode 100644 pos_cash_deposit/static/src/img/close-customer.png create mode 100644 pos_cash_deposit/static/src/js/pos_cash_deposit.js create mode 100644 pos_cash_deposit/static/src/js/pos_cash_deposit_db.js create mode 100644 pos_cash_deposit/static/src/js/pos_cash_deposit_models.js create mode 100644 pos_cash_deposit/static/src/js/pos_cash_deposit_screen.js create mode 100644 pos_cash_deposit/static/src/js/pos_cash_deposit_widget.js create mode 100644 pos_cash_deposit/static/src/xml/pos_cash_deposit.xml create mode 100644 pos_cash_deposit/view/pos_cash_deposit.xml create mode 100644 pos_pay_invoice/__init__.py create mode 100644 pos_pay_invoice/__openerp__.py create mode 100644 pos_pay_invoice/static/src/css/pos_pay_invoice.css create mode 100644 pos_pay_invoice/static/src/js/pos_pay_invoice.js create mode 100644 pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js create mode 100644 pos_pay_invoice/static/src/js/pos_pay_invoice_widget.js create mode 100644 pos_pay_invoice/static/src/xml/pos_pay_invoice.xml create mode 100644 pos_pay_invoice/view/pos_pay_invoice.xml create mode 100644 pos_pay_sale_order/__init__.py create mode 100644 pos_pay_sale_order/__openerp__.py create mode 100644 pos_pay_sale_order/static/src/css/pos_pay_sale_order.css create mode 100644 pos_pay_sale_order/static/src/js/pos_pay_sale_order.js create mode 100644 pos_pay_sale_order/static/src/js/pos_pay_sale_order_screen.js create mode 100644 pos_pay_sale_order/static/src/js/pos_pay_sale_order_widget.js create mode 100644 pos_pay_sale_order/static/src/xml/pos_pay_sale_order.xml create mode 100644 pos_pay_sale_order/view/pos_pay_sale_order.xml diff --git a/pos_cash_deposit/__init__.py b/pos_cash_deposit/__init__.py new file mode 100644 index 0000000000..51ff8e0c22 --- /dev/null +++ b/pos_cash_deposit/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2015 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import model diff --git a/pos_cash_deposit/__openerp__.py b/pos_cash_deposit/__openerp__.py new file mode 100644 index 0000000000..215d519e68 --- /dev/null +++ b/pos_cash_deposit/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2015 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + 'name': "POS Cash Deposit", + + 'summary': """Cash deposit inside the POS""", + 'author': 'ACSONE SA/NV,' + 'Odoo Community Association (OCA)', + 'website': "http://acsone.eu", + 'category': 'Point Of Sale', + 'version': '8.0.1.0.0', + 'license': 'AGPL-3', + 'depends': [ + 'point_of_sale', + ], + 'data': [ + "view/pos_cash_deposit.xml", + "data/pos_cash_deposit_product.xml", + ], + 'qweb': ['static/src/xml/pos_cash_deposit.xml'], +} diff --git a/pos_cash_deposit/data/pos_cash_deposit_product.xml b/pos_cash_deposit/data/pos_cash_deposit_product.xml new file mode 100644 index 0000000000..69819b1269 --- /dev/null +++ b/pos_cash_deposit/data/pos_cash_deposit_product.xml @@ -0,0 +1,13 @@ + + + + + Cash Deposit + + consu + + + + + + diff --git a/pos_cash_deposit/model/__init__.py b/pos_cash_deposit/model/__init__.py new file mode 100644 index 0000000000..e5a7aad1f6 --- /dev/null +++ b/pos_cash_deposit/model/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2015 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import pos_order diff --git a/pos_cash_deposit/model/pos_order.py b/pos_cash_deposit/model/pos_order.py new file mode 100644 index 0000000000..93ed86ebf3 --- /dev/null +++ b/pos_cash_deposit/model/pos_order.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- +# © 2015 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, api +import logging + +logger = logging.getLogger(__name__) + + +class pos_order(models.Model): + _inherit = 'pos.order' + + @api.multi + def _reconcile_move_account_product(self, move_id, account_id, product_id): + if move_id and account_id and product_id: + move_line_obj = self.env['account.move.line'] + move_line_ids = move_line_obj.search([('move_id', '=', move_id), + ('account_id', '=', + account_id), + ('product_id', '=', + product_id)]) + if move_line_ids: + try: + move_line_ids.reconcile(type='manual', + writeoff_acc_id=False, + writeoff_period_id=False, + writeoff_journal_id=False) + except Exception as e: + logger.warning( + 'Impossible to reconcile cash deposit items ' + str(e)) + return True + + @api.multi + def _create_account_move_line(self, session=None, move_id=None): + res = super(pos_order, self)\ + ._create_account_move_line(session=session, move_id=move_id) + account_move_line_obj = self.env['account.move.line'] + cash_deposit_product =\ + self.env.ref('pos_cash_deposit.pos_cash_deposit_product') + income_account = False + if cash_deposit_product.property_account_income.id: + income_account = cash_deposit_product\ + .property_account_income.id + elif cash_deposit_product.categ_id.property_account_income_categ.id: + income_account = cash_deposit_product.categ_id\ + .property_account_income_categ.id + for order in self: + if move_id is None: + move_id = order.move_id.id + for line in order.lines: + if line.product_id.id == cash_deposit_product.id: + name = line.product_id.name + amount = line.price_subtotal + sale_journal_id = order.sale_journal.id + current_company = order.sale_journal.company_id + period = self.env['account.period']\ + .with_context(company_id=current_company.id).find()[0] + if line.notice: + name = name + ' (' + line.notice + ')' + partner = order.partner_id and \ + self.pool.get("res.partner").\ + _find_accounting_partner(order.partner_id) or False + default_values = { + 'name': name, + 'quantity': line.qty, + 'product_id': line.product_id.id, + 'tax_code_id': False, + 'tax_amount': False, + 'date': order.date_order[:10], + 'ref': order.name, + 'partner_id': partner.id, + 'journal_id': sale_journal_id, + 'period_id': period.id, + 'move_id': move_id, + 'company_id': current_company.id, + } + transfert_account_move_values = { + 'account_id': income_account, + 'credit': ((amount < 0) and - amount) or 0.0, + 'debit': ((amount > 0) and amount) or 0.0, + } + transfert_account_move_values.update(default_values) + account_move_line_obj\ + .create(transfert_account_move_values) + receivable_account_move_values = { + 'account_id': partner.property_account_receivable.id, + 'credit': ((amount > 0) and amount) or 0.0, + 'debit': ((amount < 0) and - amount) or 0.0, + } + receivable_account_move_values.update(default_values) + account_move_line_obj\ + .create(receivable_account_move_values) + self._reconcile_move_account_product(move_id, income_account, + cash_deposit_product.id) + return res diff --git a/pos_cash_deposit/static/src/img/close-customer.png b/pos_cash_deposit/static/src/img/close-customer.png new file mode 100644 index 0000000000000000000000000000000000000000..464a286dc8666b1f790d344dd29f5d0962e89da2 GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_KJY5_^ zEPBsQa^!0=5OIl*DPZ2)QpFOAlqKl`43k@HV`&%(Or z9;f$tsvcW?hEx2CyiT6T$r{$OJ@!G5J_=X5y=iYdAo*W^i&x|18+|WWCpbFjKlmrp Q1@sMrr>mdKI;Vst0ILddIsgCw literal 0 HcmV?d00001 diff --git a/pos_cash_deposit/static/src/js/pos_cash_deposit.js b/pos_cash_deposit/static/src/js/pos_cash_deposit.js new file mode 100644 index 0000000000..b18fe4fc02 --- /dev/null +++ b/pos_cash_deposit/static/src/js/pos_cash_deposit.js @@ -0,0 +1,7 @@ +openerp.pos_cash_deposit = function (instance) { + var module = instance.point_of_sale; + pos_cash_deposit_models(instance, module); + pos_cash_deposit_db(instance, module); + pos_cash_deposit_widgets(instance, module); + pos_cash_deposit_screens(instance, module); +}; \ No newline at end of file diff --git a/pos_cash_deposit/static/src/js/pos_cash_deposit_db.js b/pos_cash_deposit/static/src/js/pos_cash_deposit_db.js new file mode 100644 index 0000000000..2a554b8a58 --- /dev/null +++ b/pos_cash_deposit/static/src/js/pos_cash_deposit_db.js @@ -0,0 +1,30 @@ +function pos_cash_deposit_db(instance, module) { //module is instance.point_of_sale + var QWeb = instance.web.qweb; + var _t = instance.web._t; + + module.PosDB = module.PosDB.extend({ + init: function (options) { + options = options || {}; + this._super(options); + var self = this + this.cash_deposit_id = false; + this.cash_deposit_product = false; + new instance.web.Model('ir.model.data').call('get_object_reference', [ 'pos_cash_deposit', 'pos_cash_deposit_product' ]).then(function (ids) { + self.cash_deposit_id = ids[1] + return new instance.web.Model('product.product').query([ 'name', 'list_price', 'price', + 'pos_categ_id', 'taxes_id', 'ean13', 'default_code', 'variants', 'to_weight', 'uom_id', + 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description', 'product_tmpl_id', + 'active' ]).filter([ + [ 'id', '=', self.cash_deposit_id ], + [ 'active', '>=', 0 ] + ]).context(null).all().then(function (products) { + self.cash_deposit_product = products[0] + }, function (err, event) { + event.preventDefault(); + }); + },function (err, event) { + event.preventDefault(); + }); + }, + }); +} \ No newline at end of file diff --git a/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js b/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js new file mode 100644 index 0000000000..339223ac39 --- /dev/null +++ b/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js @@ -0,0 +1,40 @@ +function pos_cash_deposit_models(instance, module) { //module is instance.point_of_sale + var QWeb = instance.web.qweb; + var _t = instance.web._t; + + var _super_initialize = module.Orderline.prototype.initialize; + var _super_export_as_JSON = module.Orderline.prototype.export_as_JSON; + var _super_addProduct = module.Order.prototype.addProduct; + + module.Orderline.prototype.export_as_JSON = function () { + res = _super_export_as_JSON.call(this); + res.notice = this.notice; + return res; + }; + + module.Orderline.prototype.initialize = function (attr, options) { + this.notice = options.notice; + _super_initialize.call(this, attr, options); + }; + + module.Order.prototype.addProduct = function (product, options) { + var parent = this + var orderLines = this.attributes.orderLines.models; + var trouve = false; + for (var index in orderLines) { + if (orderLines.hasOwnProperty(index)) { + if (orderLines[index].product.id == this.pos.db.cash_deposit_id) { + self.posmodel.pos_widget.screen_selector.show_popup('error', { + message: _t('Please remove cash deposit product of your ' + + 'shopping cart to process to add some products') + }); + trouve = true; + continue; + } + } + } + if (!trouve) { + _super_addProduct.call(parent, product, options); + } + } +} \ No newline at end of file diff --git a/pos_cash_deposit/static/src/js/pos_cash_deposit_screen.js b/pos_cash_deposit/static/src/js/pos_cash_deposit_screen.js new file mode 100644 index 0000000000..1aff31e533 --- /dev/null +++ b/pos_cash_deposit/static/src/js/pos_cash_deposit_screen.js @@ -0,0 +1,48 @@ +function pos_cash_deposit_screens(instance, module) { + var QWeb = instance.web.qweb; + var _t = instance.web._t; + + + module.PaymentScreenWidget.include({ + validate_order: function (options) { + options = options || {}; + var parent = this + var order = this.pos.get('selectedOrder'); + var orderLines = order.get('orderLines').models; + var trouve = false; + for (var index in orderLines) { + if (orderLines.hasOwnProperty(index)) { + if (orderLines[index].product.id == this.pos.db.cash_deposit_id) { + options['invoice'] = false; + continue; + } + } + } + this._super(options); + }, + is_cash_deposit: function(){ + var self = this; + var currentOrder = self.pos.get('selectedOrder'); + var orderlines = currentOrder.get('orderLines'); + is_cash_deposit = false; + for (i=0; i < orderlines.length && !is_cash_deposit; i++) { + if (orderlines.models[i].product.id == self.pos.db.cash_deposit_id) { + is_cash_deposit = true; + } + } + return is_cash_deposit + }, + show: function () { + this._super(); + this.pos_widget.action_bar.set_button_disabled('invoice', this.is_cash_deposit()); + }, + update_payment_summary: function () { + this._super(); + var self = this + if (this.pos_widget.action_bar) { + self.pos_widget.action_bar.set_button_disabled('invoice', this.is_cash_deposit()); + } + }, + }); + +} \ No newline at end of file diff --git a/pos_cash_deposit/static/src/js/pos_cash_deposit_widget.js b/pos_cash_deposit/static/src/js/pos_cash_deposit_widget.js new file mode 100644 index 0000000000..d3a174564f --- /dev/null +++ b/pos_cash_deposit/static/src/js/pos_cash_deposit_widget.js @@ -0,0 +1,100 @@ +function pos_cash_deposit_widgets(instance, module) { + var QWeb = instance.web.qweb; + var _t = instance.web._t; + + module.PosWidget = module.PosWidget.extend({ + build_widgets: function () { + this._super(); + this.cash_deposit_popup = new module.CashDepositPopupWidget(this, {}); + this.cash_deposit_popup.appendTo(this.$el); + this.cash_deposit_popup.hide(); + }, + }); + + module.ProductCategoriesWidget.include({ + + init: function (parent, options) { + this._super(parent, options); + }, + + renderElement: function () { + var self = this; + this._super(); + $('#cash_deposit').click(function () { + var currentOrder = self.pos.get('selectedOrder'); + var cid = currentOrder.get_client() ? currentOrder.get_client().id : 0; + if (cid != null && cid != 0) { + self.pos_widget.screen_selector.current_popup = self.pos_widget.cash_deposit_popup; + self.pos_widget.screen_selector.current_popup.show(); + } else { + self.pos_widget.screen_selector.show_popup('error', { + message: _t('You must select a customer in the order tab first !'), + }); + } + }); + } + }); + + module.CashDepositPopupWidget = module.PopUpWidget.extend({ + template: 'CashDepositPopupWidget', + show: function () { + this._super(); + this.renderElement(); + var self = this; + self.pos_widget.order_widget.disable_numpad() + this.$('.apply-button').off('click').click(function () { + var amount = $("#amount_deposit", this.$el).val(); + amount = amount.replace(',', '.'); + amount = parseFloat(amount); + if (isNaN(amount)) { + alert('Please Enter A Correct Amount Number'); + } else { + var message = $("#message_deposit", this.$el).val(); + self.pos_widget.screen_selector.close_popup(); + self.create_cash_deposit(message, amount); + } + }); + this.$('.close-button').off('click').click(function () { + self.pos_widget.screen_selector.close_popup(); + }); + }, + + hide: function () { + this._super(); + var self = this; + self.pos_widget.order_widget.enable_numpad() + }, + + create_cash_deposit: function (message, amount) { + var self = this; + product = jQuery.extend({}, self.pos.db.cash_deposit_product) + product.price = amount; + product.display_name = _t(product.name) + ' : ' + message; + order = self.pos.get('selectedOrder'); + var line = new module.Orderline({}, { + pos: order.pos, + order: order, + product: product, + notice: message + }); + var trouve = false; + var orderLines = order.get('orderLines').models; + for (var index in orderLines) { + if (orderLines.hasOwnProperty(index)) { + if (orderLines[index].product.id !== self.pos.db.cash_deposit_id) { + self.pos_widget.screen_selector.show_popup('error', { + message: _t('Please remove the products from your ' + + 'shopping cart to make to a cash deposit') + }); + trouve = true; + break; + } + } + } + if (!trouve) { + order.get('orderLines').add(line); + order.selectLine(order.getLastOrderline()); + } + } + }); +} diff --git a/pos_cash_deposit/static/src/xml/pos_cash_deposit.xml b/pos_cash_deposit/static/src/xml/pos_cash_deposit.xml new file mode 100644 index 0000000000..3d05f7b18e --- /dev/null +++ b/pos_cash_deposit/static/src/xml/pos_cash_deposit.xml @@ -0,0 +1,31 @@ + + + + + + + + + Cash Deposit + + + + + + + \ No newline at end of file diff --git a/pos_cash_deposit/view/pos_cash_deposit.xml b/pos_cash_deposit/view/pos_cash_deposit.xml new file mode 100644 index 0000000000..51b9b16618 --- /dev/null +++ b/pos_cash_deposit/view/pos_cash_deposit.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/pos_pay_invoice/__init__.py b/pos_pay_invoice/__init__.py new file mode 100644 index 0000000000..071ace3c28 --- /dev/null +++ b/pos_pay_invoice/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# © 2015 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/pos_pay_invoice/__openerp__.py b/pos_pay_invoice/__openerp__.py new file mode 100644 index 0000000000..14fac4bf6e --- /dev/null +++ b/pos_pay_invoice/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2015 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + 'name': "POS Pay Invoice", + + 'summary': """Pay invoices inside the POS""", + 'author': 'ACSONE SA/NV,' + 'Odoo Community Association (OCA)', + 'website': "http://acsone.eu", + 'category': 'Point Of Sale', + 'version': '8.0.1.0.0', + 'license': 'AGPL-3', + 'depends': [ + 'point_of_sale', + 'pos_cash_deposit', + ], + 'data': [ + 'view/pos_pay_invoice.xml', + ], + 'qweb': ['static/src/xml/pos_pay_invoice.xml'], +} diff --git a/pos_pay_invoice/static/src/css/pos_pay_invoice.css b/pos_pay_invoice/static/src/css/pos_pay_invoice.css new file mode 100644 index 0000000000..9f36decd12 --- /dev/null +++ b/pos_pay_invoice/static/src/css/pos_pay_invoice.css @@ -0,0 +1,30 @@ +.invoice-list table { + background: white; + border: solid 1px rgb(220, 220, 220); + border-radius: 3px; + -webkit-transform: translate3d(0, 0, 0); + font-size: 14px; + text-align: left; + width: 100%; +} + +.invoice-list tr { + border-bottom: 1px solid #cacaca; +} + +.invoice-list tr:hover { + background: #cacaca; +} + +.invoice-list th { + background: #e2e2e2; + text-align: left; + padding: 6px; + +} + +.invoice-list td { + background: #fff; + padding: 6px 6px 6px 12px; + text-align: left; +} diff --git a/pos_pay_invoice/static/src/js/pos_pay_invoice.js b/pos_pay_invoice/static/src/js/pos_pay_invoice.js new file mode 100644 index 0000000000..666487514a --- /dev/null +++ b/pos_pay_invoice/static/src/js/pos_pay_invoice.js @@ -0,0 +1,5 @@ +openerp.pos_pay_invoice = function (instance) { + var module = instance.point_of_sale; + pos_pay_invoice_screens(instance, module); + pos_pay_invoice_widgets(instance, module); +}; \ No newline at end of file diff --git a/pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js b/pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js new file mode 100644 index 0000000000..cc54b339e3 --- /dev/null +++ b/pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js @@ -0,0 +1,62 @@ +function pos_pay_invoice_screens(instance, module) { + + var QWeb = instance.web.qweb; + _t = instance.web._t; + round_pr = instance.web.round_precision; + + module.InvoiceScreenWidget = module.ScreenWidget.extend({ + template: 'InvoiceScreenWidget', + + show_numpad: true, + show_leftpane: true, + + invoice_list_widget: null, + + start: function () { + var self = this; + this.invoice_list_widget = new module.InvoiceListWidget(this, { + click_invoice_action: function(message, amount){ + self.pos_widget.cash_deposit_popup.create_cash_deposit(message, amount); + }, + hide_fct: function() { + self.pos_widget.screen_selector.set_current_screen('products'); + }, + }); + }, + + fetch: function(model, fields, domain, ctx) { + return new instance.web.Model(model).query(fields).filter(domain).context(ctx).all() + }, + + show: function () { + this._super(); + var self = this; + this.$el.find('.close-invoice').off('click').click(function () { + self.hide_invoice_screen(); + }); + var currentOrder = self.pos.get('selectedOrder'); + var client_id = currentOrder.get_client().id; + var invoices_list = self.fetch('account.invoice', ['id','partner_id','number','date_invoice','date_due','amount_untaxed','amount_total','residual','origin'], [['partner_id.id', '=', client_id], ['state', '=', 'open']]).then(function(invoices) { + var invoices_list = []; + for (var i = 0, len = invoices.length; i < len; i++) { + invoices_list.push(invoices[i]); + } + self.invoice_list_widget.show(invoices_list); + self.invoice_list_widget.replace($('.placeholder-InvoiceListWidget')); + }, function (err, event) { + event.preventDefault(); + self.pos_widget.screen_selector.show_popup('error',{ + message: _t('Impossible to load the list of invoices'), + comment: _t('Check your internet connection and try again.'), + }); + }); + }, + + hide_invoice_screen: function () { + var self = this; + self.pos_widget.screen_selector.set_current_screen('products'); + + }, + + }); +} diff --git a/pos_pay_invoice/static/src/js/pos_pay_invoice_widget.js b/pos_pay_invoice/static/src/js/pos_pay_invoice_widget.js new file mode 100644 index 0000000000..ec9faf77ef --- /dev/null +++ b/pos_pay_invoice/static/src/js/pos_pay_invoice_widget.js @@ -0,0 +1,99 @@ +function pos_pay_invoice_widgets(instance, module) { + var QWeb = instance.web.qweb; + var _t = instance.web._t; + var round_di = instance.web.round_decimals; + var round_pr = instance.web.round_precision; + + module.PosWidget = module.PosWidget.extend({ + build_widgets: function () { + this._super(); + this.pay_invoice_screen = new module.InvoiceScreenWidget(this, {}); + this.screen_selector.screen_set.pay_invoice = this.pay_invoice_screen; + this.pay_invoice_screen.appendTo(this.$('.screens')); + this.pay_invoice_screen.hide(); + + }, + }); + + module.ProductCategoriesWidget.include({ + + init: function(parent, options) { + this._super(parent, options); + }, + + renderElement: function () { + var self = this; + this._super(); + $('#pay_invoice_button').click(function () { + var currentOrder = self.pos.get('selectedOrder'); + var cid = currentOrder.get_client() ? currentOrder.get_client().id : 0; + if (cid != null && cid != 0) { + self.pos_widget.screen_selector.set_current_screen('pay_invoice'); + } else { + self.pos_widget.screen_selector.show_popup('error', { + message: _t('You must select a customer in the order tab first !'), + }); + } + }); + } + }); + + module.InvoiceListWidget = module.PosBaseWidget.extend({ + template: 'InvoiceListWidget', + invoice_list: null, + + init: function (parent, options) { + var self = this; + this._super(parent, options); + this.invoice_cache = new module.DomCache(); + + this.click_invoice_handler = function (e) { + var self = this; + window.open(window.location.origin + '/web#id=' + parseInt(this.dataset['invoiceId']) + '&view_type=form&model=account.invoice', '_blank'); + return new instance.web.Model('account.invoice').query(['id','partner_id','number','date_invoice','date_due','amount_untaxed','amount_total','residual','origin']).filter([['id', '=', parseInt(this.dataset['invoiceId'])]]).context(null).all().then(function(invoices) { + options.click_invoice_action(_t('POS Invoice Paiment') + ' (' + invoices[0].number + ')', invoices[0].residual); + options.hide_fct(); + }); + }; + }, + + start: function () { + }, + + show: function(invoice_list) { + this.invoice_list = invoice_list; + this.renderElement(); + }, + + render_invoice: function (invoice) { + invoice.residual = Math.round(invoice.residual*100)/100; + invoice.amount_total = Math.round(invoice.amount_total*100)/100; + invoice.amount_untaxed = Math.round(invoice.amount_untaxed*100)/100; + var cached = this.invoice_cache.get_node(invoice.id); + if (!cached) { + var invoice_html = QWeb.render('Invoice', { + widget: this, + invoice: invoice, + }); + var invoice_node = $(invoice_html); + this.invoice_cache.cache_node(invoice.id, invoice_node); + return invoice_node; + } + return cached; + }, + + renderElement: function () { + var self = this; + this._super(); + var template = openerp.qweb.render(this.template, {widget: this}); + var list_container = $(template).find('.invoice-list table tbody'); + for (var i = 0, len = this.invoice_list.length; i < len; i++) { + var invoice_node = this.render_invoice(this.invoice_list[i]); + $(invoice_node).unbind('click').click(self.click_invoice_handler); + $(list_container).append(invoice_node); + } + $(this.el).find('.invoice-list table tbody').replaceWith($(list_container)) + + } + }); +} diff --git a/pos_pay_invoice/static/src/xml/pos_pay_invoice.xml b/pos_pay_invoice/static/src/xml/pos_pay_invoice.xml new file mode 100644 index 0000000000..875d1f54b7 --- /dev/null +++ b/pos_pay_invoice/static/src/xml/pos_pay_invoice.xml @@ -0,0 +1,82 @@ + + + + + + + + Pay Invoice + + + + +
+ + + + + + + + + + +
+ +
+ + + + + + +
+ +
+
+ +
+
+
+
+ + +
+
+
+ + + + + + + + + + + + + + + + +
NumberInvoice DateDue DateSource DocumentBalanceSubtotalTotal
+ +
+
+ +
+
+ + + + + + + + + + + + +
diff --git a/pos_pay_invoice/view/pos_pay_invoice.xml b/pos_pay_invoice/view/pos_pay_invoice.xml new file mode 100644 index 0000000000..1d8a0a476a --- /dev/null +++ b/pos_pay_invoice/view/pos_pay_invoice.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/pos_pay_sale_order/__init__.py b/pos_pay_sale_order/__init__.py new file mode 100644 index 0000000000..071ace3c28 --- /dev/null +++ b/pos_pay_sale_order/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# © 2015 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/pos_pay_sale_order/__openerp__.py b/pos_pay_sale_order/__openerp__.py new file mode 100644 index 0000000000..f658367cfa --- /dev/null +++ b/pos_pay_sale_order/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2015 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + 'name': "POS Pay Sale Order", + + 'summary': """Pay a sale order directly in the POS""", + 'author': 'ACSONE SA/NV,' + 'Odoo Community Association (OCA)', + 'website': "http://acsone.eu", + 'category': 'Point Of Sale', + 'version': '8.0.1.0.0', + 'license': 'AGPL-3', + 'depends': [ + 'point_of_sale', + 'pos_cash_deposit', + ], + 'data': [ + "view/pos_pay_sale_order.xml", + ], + 'qweb': ['static/src/xml/pos_pay_sale_order.xml'], +} diff --git a/pos_pay_sale_order/static/src/css/pos_pay_sale_order.css b/pos_pay_sale_order/static/src/css/pos_pay_sale_order.css new file mode 100644 index 0000000000..0cdd18b741 --- /dev/null +++ b/pos_pay_sale_order/static/src/css/pos_pay_sale_order.css @@ -0,0 +1,30 @@ +.sale-order-list table { + background: white; + border: solid 1px rgb(220, 220, 220); + border-radius: 3px; + -webkit-transform: translate3d(0, 0, 0); + font-size: 14px; + text-align: left; + width: 100%; +} + +.sale-order-list tr { + border-bottom: 1px solid #cacaca; +} + +.sale-order-list tr:hover { + background: #cacaca; +} + +.sale-order-list th { + background: #e2e2e2; + text-align: left; + padding: 6px; + +} + +.sale-order-list td { + background: #fff; + padding: 6px 6px 6px 12px; + text-align: left; +} \ No newline at end of file diff --git a/pos_pay_sale_order/static/src/js/pos_pay_sale_order.js b/pos_pay_sale_order/static/src/js/pos_pay_sale_order.js new file mode 100644 index 0000000000..d15b534507 --- /dev/null +++ b/pos_pay_sale_order/static/src/js/pos_pay_sale_order.js @@ -0,0 +1,5 @@ +openerp.pos_pay_sale_order = function (instance) { + var module = instance.point_of_sale; + pos_pay_sale_order_screens(instance, module); + pos_pay_sale_order_widgets(instance, module); +}; \ No newline at end of file diff --git a/pos_pay_sale_order/static/src/js/pos_pay_sale_order_screen.js b/pos_pay_sale_order/static/src/js/pos_pay_sale_order_screen.js new file mode 100644 index 0000000000..a32739b4d0 --- /dev/null +++ b/pos_pay_sale_order/static/src/js/pos_pay_sale_order_screen.js @@ -0,0 +1,63 @@ +function pos_pay_sale_order_screens(instance, module) { //module is instance.point_of_sale + + var QWeb = instance.web.qweb, + _t = instance.web._t, + round_pr = instance.web.round_precision; + + module.sale_orderScreenWidget = module.ScreenWidget.extend({ + template: 'sale_orderScreenWidget', + + show_numpad: true, + show_leftpane: true, + + sale_order_list_widget: null, + + start: function () { + var self = this; + this.sale_order_list_widget = new module.sale_orderListWidget(this, { + click_sale_order_action: function(message, amount){ + self.pos_widget.cash_deposit_popup.create_cash_deposit(message, amount); + }, + hide_fct: function() { + self.pos_widget.screen_selector.set_current_screen('products'); + }, + }); + + }, + + fetch : function(model, fields, domain, ctx) { + return new instance.web.Model(model).query(fields).filter(domain).context(ctx).all() + }, + + show: function () { + this._super(); + var self = this; + this.$el.find('.close-sale_order').off('click').click(function () { + self.hide_sale_order_screen(); + }); + var currentOrder = self.pos.get('selectedOrder'); + var client_id = currentOrder.get_client().id; + var sale_orders_list = self.fetch('sale.order',['id','partner_id','name','date_order','user_id','amount_untaxed','amount_total','residual','origin'], [['partner_id.id', '=', client_id],['state', 'in', ['draft', 'sent']]]).then(function(sale_orders) { + var sale_orders_list = []; + for (var i = 0, len = sale_orders.length; i < len; i++) { + sale_orders_list.push(sale_orders[i]); + } + self.sale_order_list_widget.show(sale_orders_list); + self.sale_order_list_widget.replace($('.placeholder-sale_orderListWidget')); + }, function (err, event) { + event.preventDefault(); + self.pos_widget.screen_selector.show_popup('error',{ + message: _t('Impossible to load the list of quotation'), + comment: _t('Check your internet connection and try again.'), + }); + }); + + }, + + hide_sale_order_screen: function () { + var self = this; + self.pos_widget.screen_selector.set_current_screen('products'); + + }, + }); +} \ No newline at end of file diff --git a/pos_pay_sale_order/static/src/js/pos_pay_sale_order_widget.js b/pos_pay_sale_order/static/src/js/pos_pay_sale_order_widget.js new file mode 100644 index 0000000000..6aae4e5743 --- /dev/null +++ b/pos_pay_sale_order/static/src/js/pos_pay_sale_order_widget.js @@ -0,0 +1,96 @@ +function pos_pay_sale_order_widgets(instance, module) { + var QWeb = instance.web.qweb; + var _t = instance.web._t; + + module.PosWidget = module.PosWidget.extend({ + build_widgets: function () { + this._super(); + this.pay_sale_order_screen = new module.sale_orderScreenWidget(this, {}); + this.screen_selector.screen_set.pay_sale_order = this.pay_sale_order_screen; + this.pay_sale_order_screen.appendTo(this.$('.screens')); + this.pay_sale_order_screen.hide(); + + }, + }); + + module.ProductCategoriesWidget.include({ + + init: function(parent, options) { + this._super(parent, options); + }, + + renderElement: function () { + var self = this; + this._super(); + $('#pay_sale_order_button').click(function () { + var currentOrder = self.pos.get('selectedOrder'); + var cid = currentOrder.get_client() ? currentOrder.get_client().id : 0; + if (cid != null && cid != 0) { + self.pos_widget.screen_selector.set_current_screen('pay_sale_order'); + } else { + self.pos_widget.screen_selector.show_popup('error', { + message: _t('You must select a customer in the order tab first !'), + }); + } + }); + } + }); + + module.sale_orderListWidget = module.PosBaseWidget.extend({ + template: 'sale_orderListWidget', + sale_order_list: null, + + init: function (parent, options) { + var self = this; + this._super(parent, options); + this.sale_order_cache = new module.DomCache(); + + this.click_sale_order_handler = function (e) { + var self = this; + window.open(window.location.origin + '/web#id=' + parseInt(this.dataset['sale_orderId']) + '&view_type=form&model=sale.order', '_blank'); + return new instance.web.Model('sale.order').query(['id','partner_id','name','date_order','user_id','amount_total','amount_untaxed']).filter([['id', '=', parseInt(this.dataset['sale_orderId'])]]).context(null).all().then(function(sale_orders) { + options.click_sale_order_action(_t('POS Sale Order Paiment') + ' (' + sale_orders[0].name + ')', (sale_orders[0].amount_total * 0.5)); + options.hide_fct(); + }); + }; + }, + + start: function () { + var self = this; + }, + + show: function(sale_order_list) { + this.sale_order_list = sale_order_list; + this.renderElement(); + }, + + render_sale_order: function (sale_order) { + sale_order.amount_total = Math.round(sale_order.amount_total*100)/100 + var cached = this.sale_order_cache.get_node(sale_order.id); + if (!cached) { + var sale_order_html = QWeb.render('sale_order', { + widget: this, + sale_order: sale_order, + }); + var sale_order_node = $(sale_order_html); + this.sale_order_cache.cache_node(sale_order.id, sale_order_node); + return sale_order_node; + } + return cached; + }, + + renderElement: function () { + var self = this; + this._super(); + var template = openerp.qweb.render(this.template, {widget: this}); + var list_container = $(template).find('.sale-order-list table tbody'); + for (var i = 0, len = this.sale_order_list.length; i < len; i++) { + var sale_order_node = this.render_sale_order(this.sale_order_list[i]); + $(sale_order_node).unbind('click').click(self.click_sale_order_handler); + $(list_container).append(sale_order_node); + } + $(this.el).find('.sale-order-list table tbody').replaceWith($(list_container)) + + } + }); +} \ No newline at end of file diff --git a/pos_pay_sale_order/static/src/xml/pos_pay_sale_order.xml b/pos_pay_sale_order/static/src/xml/pos_pay_sale_order.xml new file mode 100644 index 0000000000..58ed59ba86 --- /dev/null +++ b/pos_pay_sale_order/static/src/xml/pos_pay_sale_order.xml @@ -0,0 +1,75 @@ + + + + + + + + + Pay Quotation + + + + +
+ + + + + + + + + + +
+ +
+ + + + + + +
+ +
+
+ +
+
+
+
+ + +
+
+
+ + + + + + + + + + + + +
NameDateTotal
+ +
+
+ +
+
+ + + + + + + + +
\ No newline at end of file diff --git a/pos_pay_sale_order/view/pos_pay_sale_order.xml b/pos_pay_sale_order/view/pos_pay_sale_order.xml new file mode 100644 index 0000000000..8589484248 --- /dev/null +++ b/pos_pay_sale_order/view/pos_pay_sale_order.xml @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file From fed7b59ceecf4b435f675ddb46800276d18b9877 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Wed, 23 Dec 2015 15:47:31 +0100 Subject: [PATCH 2/5] [FIX] Use commercial_partner_id instead of partner_id to get invoice in POS --- pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js b/pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js index cc54b339e3..3cf9252a01 100644 --- a/pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js +++ b/pos_pay_invoice/static/src/js/pos_pay_invoice_screen.js @@ -36,7 +36,7 @@ function pos_pay_invoice_screens(instance, module) { }); var currentOrder = self.pos.get('selectedOrder'); var client_id = currentOrder.get_client().id; - var invoices_list = self.fetch('account.invoice', ['id','partner_id','number','date_invoice','date_due','amount_untaxed','amount_total','residual','origin'], [['partner_id.id', '=', client_id], ['state', '=', 'open']]).then(function(invoices) { + var invoices_list = self.fetch('account.invoice', ['id','partner_id','number','date_invoice','date_due','amount_untaxed','amount_total','residual','origin'], [['commercial_partner_id.id', '=', client_id], ['state', '=', 'open'], ['type', '=', 'out_invoice']]).then(function(invoices) { var invoices_list = []; for (var i = 0, len = invoices.length; i < len; i++) { invoices_list.push(invoices[i]); From a15692a94b7a0025d8bf851fe85c0d0427c2bdd6 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Mon, 4 Jan 2016 08:37:37 +0100 Subject: [PATCH 3/5] [FIX] Bad posmodel --- pos_cash_deposit/static/src/js/pos_cash_deposit_models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js b/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js index 339223ac39..e288df1c83 100644 --- a/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js +++ b/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js @@ -24,7 +24,7 @@ function pos_cash_deposit_models(instance, module) { //module is instance.point_ for (var index in orderLines) { if (orderLines.hasOwnProperty(index)) { if (orderLines[index].product.id == this.pos.db.cash_deposit_id) { - self.posmodel.pos_widget.screen_selector.show_popup('error', { + self.pos_widget.screen_selector.show_popup('error', { message: _t('Please remove cash deposit product of your ' + 'shopping cart to process to add some products') }); From 91a2f65682634effef828bb3bdcf6ba2630ae06e Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Mon, 8 Feb 2016 13:39:52 +0100 Subject: [PATCH 4/5] [ADD] Allow to add other product with cash deposit in the same order. --- .../static/src/js/pos_cash_deposit_models.js | 21 ------------------- .../static/src/js/pos_cash_deposit_widget.js | 19 ++--------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js b/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js index e288df1c83..97c0566887 100644 --- a/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js +++ b/pos_cash_deposit/static/src/js/pos_cash_deposit_models.js @@ -16,25 +16,4 @@ function pos_cash_deposit_models(instance, module) { //module is instance.point_ this.notice = options.notice; _super_initialize.call(this, attr, options); }; - - module.Order.prototype.addProduct = function (product, options) { - var parent = this - var orderLines = this.attributes.orderLines.models; - var trouve = false; - for (var index in orderLines) { - if (orderLines.hasOwnProperty(index)) { - if (orderLines[index].product.id == this.pos.db.cash_deposit_id) { - self.pos_widget.screen_selector.show_popup('error', { - message: _t('Please remove cash deposit product of your ' + - 'shopping cart to process to add some products') - }); - trouve = true; - continue; - } - } - } - if (!trouve) { - _super_addProduct.call(parent, product, options); - } - } } \ No newline at end of file diff --git a/pos_cash_deposit/static/src/js/pos_cash_deposit_widget.js b/pos_cash_deposit/static/src/js/pos_cash_deposit_widget.js index d3a174564f..63581bede0 100644 --- a/pos_cash_deposit/static/src/js/pos_cash_deposit_widget.js +++ b/pos_cash_deposit/static/src/js/pos_cash_deposit_widget.js @@ -77,24 +77,9 @@ function pos_cash_deposit_widgets(instance, module) { product: product, notice: message }); - var trouve = false; var orderLines = order.get('orderLines').models; - for (var index in orderLines) { - if (orderLines.hasOwnProperty(index)) { - if (orderLines[index].product.id !== self.pos.db.cash_deposit_id) { - self.pos_widget.screen_selector.show_popup('error', { - message: _t('Please remove the products from your ' + - 'shopping cart to make to a cash deposit') - }); - trouve = true; - break; - } - } - } - if (!trouve) { - order.get('orderLines').add(line); - order.selectLine(order.getLastOrderline()); - } + order.get('orderLines').add(line); + order.selectLine(order.getLastOrderline()); } }); } From 5ca9243a7604efb44ca10b6770bd2014c1f21d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pigeon?= Date: Wed, 26 Apr 2017 11:50:01 +0200 Subject: [PATCH 5/5] [ADD] add setup for pos_cash_deposit, pos_pay_invoice, pos_pay_sale_order --- setup/pos_cash_deposit/odoo_addons/__init__.py | 1 + setup/pos_cash_deposit/odoo_addons/pos_cash_deposit | 1 + setup/pos_cash_deposit/setup.py | 6 ++++++ setup/pos_pay_invoice/odoo_addons/__init__.py | 1 + setup/pos_pay_invoice/odoo_addons/pos_pay_invoice | 1 + setup/pos_pay_invoice/setup.py | 6 ++++++ setup/pos_pay_sale_order/odoo_addons/__init__.py | 1 + setup/pos_pay_sale_order/odoo_addons/pos_pay_sale_order | 1 + setup/pos_pay_sale_order/setup.py | 6 ++++++ 9 files changed, 24 insertions(+) create mode 100644 setup/pos_cash_deposit/odoo_addons/__init__.py create mode 120000 setup/pos_cash_deposit/odoo_addons/pos_cash_deposit create mode 100644 setup/pos_cash_deposit/setup.py create mode 100644 setup/pos_pay_invoice/odoo_addons/__init__.py create mode 120000 setup/pos_pay_invoice/odoo_addons/pos_pay_invoice create mode 100644 setup/pos_pay_invoice/setup.py create mode 100644 setup/pos_pay_sale_order/odoo_addons/__init__.py create mode 120000 setup/pos_pay_sale_order/odoo_addons/pos_pay_sale_order create mode 100644 setup/pos_pay_sale_order/setup.py diff --git a/setup/pos_cash_deposit/odoo_addons/__init__.py b/setup/pos_cash_deposit/odoo_addons/__init__.py new file mode 100644 index 0000000000..de40ea7ca0 --- /dev/null +++ b/setup/pos_cash_deposit/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/pos_cash_deposit/odoo_addons/pos_cash_deposit b/setup/pos_cash_deposit/odoo_addons/pos_cash_deposit new file mode 120000 index 0000000000..3adc99c4a7 --- /dev/null +++ b/setup/pos_cash_deposit/odoo_addons/pos_cash_deposit @@ -0,0 +1 @@ +../../../pos_cash_deposit \ No newline at end of file diff --git a/setup/pos_cash_deposit/setup.py b/setup/pos_cash_deposit/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_cash_deposit/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/pos_pay_invoice/odoo_addons/__init__.py b/setup/pos_pay_invoice/odoo_addons/__init__.py new file mode 100644 index 0000000000..de40ea7ca0 --- /dev/null +++ b/setup/pos_pay_invoice/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/pos_pay_invoice/odoo_addons/pos_pay_invoice b/setup/pos_pay_invoice/odoo_addons/pos_pay_invoice new file mode 120000 index 0000000000..98bb21dcd8 --- /dev/null +++ b/setup/pos_pay_invoice/odoo_addons/pos_pay_invoice @@ -0,0 +1 @@ +../../../pos_pay_invoice \ No newline at end of file diff --git a/setup/pos_pay_invoice/setup.py b/setup/pos_pay_invoice/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_pay_invoice/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/pos_pay_sale_order/odoo_addons/__init__.py b/setup/pos_pay_sale_order/odoo_addons/__init__.py new file mode 100644 index 0000000000..de40ea7ca0 --- /dev/null +++ b/setup/pos_pay_sale_order/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/pos_pay_sale_order/odoo_addons/pos_pay_sale_order b/setup/pos_pay_sale_order/odoo_addons/pos_pay_sale_order new file mode 120000 index 0000000000..849c9de75d --- /dev/null +++ b/setup/pos_pay_sale_order/odoo_addons/pos_pay_sale_order @@ -0,0 +1 @@ +../../../pos_pay_sale_order \ No newline at end of file diff --git a/setup/pos_pay_sale_order/setup.py b/setup/pos_pay_sale_order/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_pay_sale_order/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)