diff --git a/multi_branch_pos/README.rst b/multi_branch_pos/README.rst new file mode 100644 index 000000000..6fa67d6de --- /dev/null +++ b/multi_branch_pos/README.rst @@ -0,0 +1,45 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Multi Branch POS +================ +This module helps you to link POS with Company Branches. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Sagarika@cybrosys + version 14: Sagarika@cybrosys + version 15: Sagarika@cybrosys + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ + + diff --git a/multi_branch_pos/__init__.py b/multi_branch_pos/__init__.py new file mode 100644 index 000000000..145aee99e --- /dev/null +++ b/multi_branch_pos/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models +from . import report + diff --git a/multi_branch_pos/__manifest__.py b/multi_branch_pos/__manifest__.py new file mode 100644 index 000000000..3da47cf4c --- /dev/null +++ b/multi_branch_pos/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +{ + 'name': "Multiple Branch Setup for POS", + 'version': "15.0.1.0.0", + 'summary': """ Multiple Branch Unit Operation Setup for Odoo POS""", + 'description': """ Multiple Branch Unit Operation Setup for Odoo POS""", + 'author': "Cybrosys Techno Solutions", + 'company': "Cybrosys Techno Solutions", + 'maintainer': "Cybrosys Techno Solutions", + 'website': "https://cybrosys.com/", + 'category': 'Tools', + 'depends': ['base', 'multi_branch_base', 'point_of_sale'], + 'data': [ + 'security/pos_security.xml', + 'views/branch_pos_config_views.xml', + 'views/branch_pos_orders_views.xml', + 'views/branch_pos_session_views.xml', + 'report/pos_order_report.xml' + ], + 'images': ['static/description/banner.jpg'], + 'assets': { + 'point_of_sale.assets': [ + 'multi_branch_pos/static/src/js/branch.js', + ], + 'web.assets_qweb': [ + 'multi_branch_pos/static/src/xml/branch.xml', + ], + }, + 'license': "AGPL-3", + 'installable': True, + 'application': False +} diff --git a/multi_branch_pos/doc/RELEASE_NOTES.md b/multi_branch_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..f62f150fc --- /dev/null +++ b/multi_branch_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,9 @@ +## Module + +#### 09.11.2022 +#### Version 15.0.1.0.0 +#### ADD +Initial Commit + + + diff --git a/multi_branch_pos/models/__init__.py b/multi_branch_pos/models/__init__.py new file mode 100644 index 000000000..20b31d5de --- /dev/null +++ b/multi_branch_pos/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import branch_pos_config +from . import branch_pos_orders +from . import branch_pos_session +from . import account_bank_statement diff --git a/multi_branch_pos/models/account_bank_statement.py b/multi_branch_pos/models/account_bank_statement.py new file mode 100644 index 000000000..24e013486 --- /dev/null +++ b/multi_branch_pos/models/account_bank_statement.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +"""account bank statement""" + +from odoo import fields, models, _ +from odoo.exceptions import UserError +from odoo.tools.misc import formatLang + + +class AccountBankStatement(models.Model): + """inherit pos config to add new branch field""" + _inherit = 'account.bank.statement' + + branch_id = fields.Many2one('res.branch') + + def _check_balance_end_real_same_as_computed(self): + ''' Check the balance_end_real (encoded manually by the user) is equals to the balance_end (computed by odoo). + In case of a cash statement, the different is set automatically to a profit/loss account. + ''' + for stmt in self: + if not stmt.currency_id.is_zero(stmt.difference): + if stmt.journal_type == 'cash': + st_line_vals = { + 'statement_id': stmt.id, + 'journal_id': stmt.journal_id.id, + 'amount': stmt.difference, + 'date': stmt.date, + 'branch_id': stmt.branch_id.id + } + + if stmt.difference < 0.0: + if not stmt.journal_id.loss_account_id: + raise UserError(_('Please go on the %s journal and define a Loss Account. This account will be used to record cash difference.', stmt.journal_id.name)) + + st_line_vals['payment_ref'] = _("Cash difference observed during the counting (Loss)") + st_line_vals['counterpart_account_id'] = stmt.journal_id.loss_account_id.id + else: + # statement.difference > 0.0 + if not stmt.journal_id.profit_account_id: + raise UserError(_('Please go on the %s journal and define a Profit Account. This account will be used to record cash difference.', stmt.journal_id.name)) + + st_line_vals['payment_ref'] = _("Cash difference observed during the counting (Profit)") + st_line_vals['counterpart_account_id'] = stmt.journal_id.profit_account_id.id + + self.env['account.bank.statement.line'].create(st_line_vals) + else: + balance_end_real = formatLang(self.env, stmt.balance_end_real, currency_obj=stmt.currency_id) + balance_end = formatLang(self.env, stmt.balance_end, currency_obj=stmt.currency_id) + raise UserError(_( + 'The ending balance is incorrect !\nThe expected balance (%(real_balance)s) is different from the computed one (%(computed_balance)s).', + real_balance=balance_end_real, + computed_balance=balance_end + )) + return True \ No newline at end of file diff --git a/multi_branch_pos/models/branch_pos_config.py b/multi_branch_pos/models/branch_pos_config.py new file mode 100644 index 000000000..495deaea6 --- /dev/null +++ b/multi_branch_pos/models/branch_pos_config.py @@ -0,0 +1,183 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +"""pos config""" + +from odoo import fields, models, api + + +class PointOfSaleBranch(models.Model): + """inherit pos config to add new branch field""" + _inherit = 'pos.config' + + branch_id = fields.Many2one('res.branch', string='Branch', store=True, + readonly=False, compute='_compute_branch') + branch_name = fields.Char(string="Branch Name", store=True, + related='branch_id.name') + email = fields.Char(related='branch_id.email', store=True) + phone = fields.Char(related='branch_id.phone', store=True) + website = fields.Char(related='branch_id.website', store=True) + allowed_branch_ids = fields.Many2many('res.branch', + string="Allowed Branches", + compute='_compute_allowed_branch_ids') + + @api.depends('company_id') + def _compute_allowed_branch_ids(self): + for pos in self: + pos.allowed_branch_ids = self.env.user.branch_ids.ids + + @api.depends('company_id') + def _compute_branch(self): + for order in self: + pos_company = order.company_id if order.company_id else self.env.company + branch_ids = self.env.user.branch_ids + branch = branch_ids.filtered( + lambda branch: branch.company_id == pos_company) + if branch: + order.branch_id = branch.ids[0] + else: + order.branch_id = False + + def _default_picking_type_id(self): + """methode to set default picking type""" + if self.env.user.branch_id: + picking = self.env['stock.warehouse'].search( + [('branch_id', '=', self.env.user.branch_id.id), + ('company_id', '=', self.env.company.id)], + limit=1) + if not picking: + picking = self.env['stock.warehouse'].search( + [('branch_id', '=', False), + ('company_id', '=', self.env.company.id)], + limit=1) + return picking.pos_type_id.id + return self.env['stock.warehouse'].search( + [('company_id', '=', self.env.company.id)], limit=1).pos_type_id.id + + def _default_sale_journal(self): + """methode to set default sale journal""" + if self.env.user.branch_id: + sales_journal = self.env['account.journal'].search( + [('type', 'in', ('sale', 'general')), + ('company_id', '=', self.env.company.id), + ('branch_id', '=', self.env.user.branch_id.id), + ('code', 'ilike', 'POSS')], limit=1) + if not sales_journal: + sales_journal = self.env['account.journal'].search( + [('type', 'in', ('sale', 'general')), + ('company_id', '=', self.env.company.id), + ('branch_id', '=', False), + ('code', 'ilike', 'POSS')], limit=1) + return sales_journal + return self.env['account.journal'].search([ + ('type', 'in', ('sale', 'general')), ('company_id', '=', self.env.company.id), + ('code', '=', 'POSS')], limit=1) + + def _default_invoice_journal(self): + """methode to set default invoice journal""" + if self.env.user.branch_id: + invoice_journal = self.env['account.journal'].search( + [('type', '=', 'sale'), + ('company_id', '=', self.env.company.id), + ('branch_id', '=', self.env.user.branch_id.id)], limit=1) + if not invoice_journal: + invoice_journal = self.env['account.journal'].search( + [('type', '=', 'sale'), + ('company_id', '=', self.env.company.id), + ('branch_id', '=', False)], limit=1) + return invoice_journal + return self.env['account.journal'].search( + [('type', '=', 'sale'), + ('company_id', '=', self.env.company.id)], limit=1) + + picking_type_id = fields.Many2one( + 'stock.picking.type', + string='Operation Type', + default=_default_picking_type_id, + required=True, + domain="[('code', '=', 'outgoing'), " + "('warehouse_id.company_id', '=', company_id)," + "'|', ('warehouse_id.branch_id', '=', branch_id)," + " ('warehouse_id.branch_id', '=', False)]", + ondelete='restrict') + + journal_id = fields.Many2one( + 'account.journal', string='Sales Journal', + domain=[('type', 'in', ('general', 'sale'))], + help="Accounting journal used to post sales entries.", + default=_default_sale_journal, + ondelete='restrict') + invoice_journal_id = fields.Many2one( + 'account.journal', string='Invoice Journal', + domain=[('type', '=', 'sale')], + help="Accounting journal used to create invoices.", + default=_default_invoice_journal) + + @api.onchange('branch_id') + def onchange_branch(self): + print("onchange_branch") + for pos in self: + if pos.branch_id: + picking = self.env['stock.warehouse'].search( + [('branch_id', '=', pos.branch_id.id), + ('company_id', '=', self.env.company.id)], + limit=1) + print("1", picking.name) + if not picking: + picking = self.env['stock.warehouse'].search( + [('branch_id', '=', False), + ('company_id', '=', self.env.company.id)], + limit=1) + sales_journal = self.env['account.journal'].search( + [('type', 'in', ('sale', 'general')), + ('company_id', '=', self.env.company.id), + ('branch_id', '=', pos.branch_id.id), + ('code', 'ilike', 'POSS')], limit=1) + if not sales_journal: + sales_journal = self.env['account.journal'].search( + [('type', 'in', ('sale', 'general')), + ('company_id', '=', self.env.company.id), + ('branch_id', '=', False), + ('code', 'ilike', 'POSS')], limit=1) + invoice_journal = self.env['account.journal'].search( + [('type', '=', 'sale'), + ('company_id', '=', self.env.company.id), + ('branch_id', '=', pos.branch_id.id)], limit=1) + if not invoice_journal: + invoice_journal = self.env['account.journal'].search( + [('type', '=', 'sale'), + ('company_id', '=', self.env.company.id), + ('branch_id', '=', False)], limit=1) + else: + picking = self.env['stock.warehouse'].search( + [('company_id', '=', self.env.company.id)], + limit=1) + sales_journal = self.env['account.journal'].search([ + ('type', 'in', ('sale', 'general')), + ('company_id', '=', self.env.company.id), + ('code', '=', 'POSS')], limit=1) + invoice_journal = self.env['account.journal'].search( + [('type', '=', 'sale'), + ('company_id', '=', self.env.company.id)], limit=1) + self.picking_type_id = picking.pos_type_id.id + self.journal_id = sales_journal.id + self.invoice_journal_id = invoice_journal.id diff --git a/multi_branch_pos/models/branch_pos_orders.py b/multi_branch_pos/models/branch_pos_orders.py new file mode 100644 index 000000000..4c6132885 --- /dev/null +++ b/multi_branch_pos/models/branch_pos_orders.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +"""pos order""" + +import logging +from datetime import timedelta +from functools import partial + +import psycopg2 +import pytz + +from odoo import api, fields, models, tools, _ +from odoo.tools import float_is_zero, float_round +from odoo.exceptions import ValidationError, UserError +from odoo.http import request +from odoo.osv.expression import AND +import base64 + +_logger = logging.getLogger(__name__) + + +class BranchPosOrder(models.Model): + """inherit pos order to add branch field""" + _inherit = "pos.order" + _description = "Point of Sale Orders" + + branch_id = fields.Many2one('res.branch', + compute='_compute_branch', + string='Branch', + store=True) + + @api.depends('session_id') + def _compute_branch(self): + """methode to compute branch""" + for order in self: + order.branch_id = order.session_id.branch_id diff --git a/multi_branch_pos/models/branch_pos_session.py b/multi_branch_pos/models/branch_pos_session.py new file mode 100644 index 000000000..8d23d6581 --- /dev/null +++ b/multi_branch_pos/models/branch_pos_session.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +"""pos session""" + + +from odoo import api, fields, models, _, Command +from odoo.tools import float_compare + + +class PosSession(models.Model): + """inherit pos session to add branch field""" + _inherit = 'pos.session' + + branch_id = fields.Many2one('res.branch', related='config_id.branch_id', + string="Branch", readonly=True) + + def _create_account_move(self, balancing_account=False, amount_to_balance=0, bank_payment_method_diffs=None): + """ Create account.move and account.move.line records for this session. + + Side-effects include: + - setting self.move_id to the created account.move record + - creating and validating account.bank.statement for cash payments + - reconciling cash receivable lines, invoice receivable lines and stock output lines + """ + journal = self.config_id.journal_id + # Passing default_journal_id for the calculation of default currency of account move + # See _get_default_currency in the account/account_move.py. + account_move = self.env['account.move'].with_context(default_journal_id=journal.id).create({ + 'journal_id': journal.id, + 'date': fields.Date.context_today(self), + 'ref': self.name, + 'branch_id': self.branch_id.id + }) + self.write({'move_id': account_move.id}) + + data = {'bank_payment_method_diffs': bank_payment_method_diffs or {}} + data = self._accumulate_amounts(data) + data = self._create_non_reconciliable_move_lines(data) + data = self._create_bank_payment_moves(data) + data = self._create_pay_later_receivable_lines(data) + data = self._create_cash_statement_lines_and_cash_move_lines(data) + data = self._create_invoice_receivable_lines(data) + data = self._create_stock_output_lines(data) + if balancing_account and amount_to_balance: + data = self._create_balancing_line(data, balancing_account, amount_to_balance) + + return data + + def _create_split_account_payment(self, payment, amounts): + payment_method = payment.payment_method_id + if not payment_method.journal_id: + return self.env['account.move.line'] + outstanding_account = payment_method.outstanding_account_id or self.company_id.account_journal_payment_debit_account_id + account_payment = self.env['account.payment'].create({ + 'amount': amounts['amount'], + 'partner_id': payment.partner_id.id, + 'journal_id': payment_method.journal_id.id, + 'force_outstanding_account_id': outstanding_account.id, + 'ref': _('%s POS payment of %s in %s') % (payment_method.name, payment.partner_id.display_name, self.name), + 'pos_payment_method_id': payment_method.id, + 'pos_session_id': self.id, + 'branch_id': self.branch_id.id + }) + account_payment.action_post() + return account_payment.move_id.line_ids.filtered(lambda line: line.account_id == account_payment.destination_account_id) + + def _create_combine_account_payment(self, payment_method, amounts, diff_amount): + outstanding_account = payment_method.outstanding_account_id or self.company_id.account_journal_payment_debit_account_id + destination_account = self._get_receivable_account(payment_method) + + if float_compare(amounts['amount'], 0, precision_rounding=self.currency_id.rounding) < 0: + # revert the accounts because account.payment doesn't accept negative amount. + outstanding_account, destination_account = destination_account, outstanding_account + + account_payment = self.env['account.payment'].create({ + 'amount': abs(amounts['amount']), + 'journal_id': payment_method.journal_id.id, + 'force_outstanding_account_id': outstanding_account.id, + 'destination_account_id': destination_account.id, + 'ref': _('Combine %s POS payments from %s') % (payment_method.name, self.name), + 'pos_payment_method_id': payment_method.id, + 'pos_session_id': self.id, + 'branch_id': self.branch_id.id + }) + + diff_amount_compare_to_zero = self.currency_id.compare_amounts(diff_amount, 0) + if diff_amount_compare_to_zero != 0: + self._apply_diff_on_account_payment_move(account_payment, payment_method, diff_amount) + + account_payment.action_post() + return account_payment.move_id.line_ids.filtered(lambda line: line.account_id == account_payment.destination_account_id) + + def _create_diff_account_move_for_split_payment_method(self, payment_method, diff_amount): + self.ensure_one() + + get_diff_vals_result = self._get_diff_vals(payment_method.id, diff_amount) + if not get_diff_vals_result: + return + + source_vals, dest_vals = get_diff_vals_result + diff_move = self.env['account.move'].create({ + 'journal_id': payment_method.journal_id.id, + 'date': fields.Date.context_today(self), + 'ref': self._get_diff_account_move_ref(payment_method), + 'line_ids': [Command.create(source_vals), Command.create(dest_vals)], + 'branch_id': self.branch_id.id + }) + diff_move._post() diff --git a/multi_branch_pos/report/__init__.py b/multi_branch_pos/report/__init__.py new file mode 100644 index 000000000..641cd28c7 --- /dev/null +++ b/multi_branch_pos/report/__init__.py @@ -0,0 +1 @@ +from . import branch_pos_order_report diff --git a/multi_branch_pos/report/branch_pos_order_report.py b/multi_branch_pos/report/branch_pos_order_report.py new file mode 100644 index 000000000..834054404 --- /dev/null +++ b/multi_branch_pos/report/branch_pos_order_report.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +"""pos reports""" + +import re + +from odoo import api, fields, models +from odoo.exceptions import UserError +from odoo.osv.expression import expression + + +class PosReport(models.Model): + """inherited report.pos.order""" + _inherit = "report.pos.order" + + branch_id = fields.Many2one('res.branch', 'Branch', readonly=True) + + def _select(self): + """override select methode to add branch""" + return super(PosReport, self)._select() + ", s.branch_id as branch_id" + + def _group_by(self): + """override groupby methode""" + return super(PosReport, self)._group_by() + ", s.branch_id" diff --git a/multi_branch_pos/report/pos_order_report.xml b/multi_branch_pos/report/pos_order_report.xml new file mode 100644 index 000000000..6e81dbf42 --- /dev/null +++ b/multi_branch_pos/report/pos_order_report.xml @@ -0,0 +1,14 @@ + + + + pos.order.search.view.inherit + report.pos.order + + + + + + + + + \ No newline at end of file diff --git a/multi_branch_pos/security/pos_security.xml b/multi_branch_pos/security/pos_security.xml new file mode 100644 index 000000000..cede1ede9 --- /dev/null +++ b/multi_branch_pos/security/pos_security.xml @@ -0,0 +1,37 @@ + + + + Branch POS Rule + + + ['|',('branch_id','=',False),('branch_id', 'in', user.branch_ids.ids)] + + + + + + Branch POS Order Rule + + + ['|',('branch_id','=',False),('branch_id', 'in', user.branch_ids.ids)] + + + + + + Branch POS Session Rule + + + ['|',('branch_id','=',False),('branch_id', 'in', user.branch_ids.ids)] + + + + + + Branch POS Report Rule + + + ['|',('branch_id','=',False),('branch_id', 'in', user.branch_ids.ids)] + + + \ No newline at end of file diff --git a/multi_branch_pos/static/description/assets/icons/check.png b/multi_branch_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/check.png differ diff --git a/multi_branch_pos/static/description/assets/icons/chevron.png b/multi_branch_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/chevron.png differ diff --git a/multi_branch_pos/static/description/assets/icons/cogs.png b/multi_branch_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/cogs.png differ diff --git a/multi_branch_pos/static/description/assets/icons/consultation.png b/multi_branch_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/consultation.png differ diff --git a/multi_branch_pos/static/description/assets/icons/ecom-black.png b/multi_branch_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/ecom-black.png differ diff --git a/multi_branch_pos/static/description/assets/icons/education-black.png b/multi_branch_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/education-black.png differ diff --git a/multi_branch_pos/static/description/assets/icons/hotel-black.png b/multi_branch_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/hotel-black.png differ diff --git a/multi_branch_pos/static/description/assets/icons/license.png b/multi_branch_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/license.png differ diff --git a/multi_branch_pos/static/description/assets/icons/lifebuoy.png b/multi_branch_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/multi_branch_pos/static/description/assets/icons/logo.png b/multi_branch_pos/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/logo.png differ diff --git a/multi_branch_pos/static/description/assets/icons/manufacturing-black.png b/multi_branch_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/multi_branch_pos/static/description/assets/icons/pos-black.png b/multi_branch_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/pos-black.png differ diff --git a/multi_branch_pos/static/description/assets/icons/puzzle.png b/multi_branch_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/puzzle.png differ diff --git a/multi_branch_pos/static/description/assets/icons/restaurant-black.png b/multi_branch_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/multi_branch_pos/static/description/assets/icons/service-black.png b/multi_branch_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/service-black.png differ diff --git a/multi_branch_pos/static/description/assets/icons/trading-black.png b/multi_branch_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/trading-black.png differ diff --git a/multi_branch_pos/static/description/assets/icons/training.png b/multi_branch_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/training.png differ diff --git a/multi_branch_pos/static/description/assets/icons/update.png b/multi_branch_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/update.png differ diff --git a/multi_branch_pos/static/description/assets/icons/user.png b/multi_branch_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/user.png differ diff --git a/multi_branch_pos/static/description/assets/icons/wrench.png b/multi_branch_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/multi_branch_pos/static/description/assets/icons/wrench.png differ diff --git a/multi_branch_pos/static/description/assets/modules/barcode_image.png b/multi_branch_pos/static/description/assets/modules/barcode_image.png new file mode 100644 index 000000000..cfb5be33c Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/barcode_image.png differ diff --git a/multi_branch_pos/static/description/assets/modules/biometric_image.png b/multi_branch_pos/static/description/assets/modules/biometric_image.png new file mode 100644 index 000000000..a0969fcb5 Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/biometric_image.png differ diff --git a/multi_branch_pos/static/description/assets/modules/export_image.png b/multi_branch_pos/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/export_image.png differ diff --git a/multi_branch_pos/static/description/assets/modules/login_image.png b/multi_branch_pos/static/description/assets/modules/login_image.png new file mode 100644 index 000000000..4fbe85ac1 Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/login_image.png differ diff --git a/multi_branch_pos/static/description/assets/modules/payroll_image.png b/multi_branch_pos/static/description/assets/modules/payroll_image.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/payroll_image.png differ diff --git a/multi_branch_pos/static/description/assets/modules/sale_image.png b/multi_branch_pos/static/description/assets/modules/sale_image.png new file mode 100644 index 000000000..004c61a9e Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/sale_image.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/hero.png b/multi_branch_pos/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..4bb7136ed Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/hero.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/pos1.png b/multi_branch_pos/static/description/assets/screenshots/pos1.png new file mode 100644 index 000000000..d2ef0e70f Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/pos1.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/pos2.png b/multi_branch_pos/static/description/assets/screenshots/pos2.png new file mode 100644 index 000000000..b64590e76 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/pos2.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/pos3.png b/multi_branch_pos/static/description/assets/screenshots/pos3.png new file mode 100644 index 000000000..f4a87c2d7 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/pos3.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/pos4.png b/multi_branch_pos/static/description/assets/screenshots/pos4.png new file mode 100644 index 000000000..d3243397b Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/pos4.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/pos5.png b/multi_branch_pos/static/description/assets/screenshots/pos5.png new file mode 100644 index 000000000..0f781c792 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/pos5.png differ diff --git a/multi_branch_pos/static/description/banner.png b/multi_branch_pos/static/description/banner.png new file mode 100644 index 000000000..8f7e02ddb Binary files /dev/null and b/multi_branch_pos/static/description/banner.png differ diff --git a/multi_branch_pos/static/description/icon.png b/multi_branch_pos/static/description/icon.png new file mode 100644 index 000000000..4869b1d48 Binary files /dev/null and b/multi_branch_pos/static/description/icon.png differ diff --git a/multi_branch_pos/static/description/index.html b/multi_branch_pos/static/description/index.html new file mode 100644 index 000000000..66418d17c --- /dev/null +++ b/multi_branch_pos/static/description/index.html @@ -0,0 +1,678 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Multi Branch Operations Setup for Odoo POS

+

+ Multi Branch Operations Setup for Odoo POS +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ This module helps to control multiple branches of a single company on POS.Here a branch can be set for each POS.After configuring a branch for a POS, then thereafter + all the operations related to the particular POS will be related with the branch. This module requires the base Branch module.After installing the base Branch + module and POS Branch addon, the user can implement the branch concept on Odoo POS.

+ +
+
+ +
+
+

+ Configuration +

+
+ +
+

+ No additional configuration required

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Community & Enterprise Support

+

+ Available in Odoo 14.0 Community and Enterprise.

+
+
+ +
+
+ +
+
+

+ Branch for POS.

+

+ Added Branch for POS Configuration.

+
+
+ +
+
+ +
+
+

+ Branch for POS Session.

+

+ Branch added for Session based on the POS.

+
+
+ +
+
+ +
+
+

+ Branch for POS Orders.

+

+ Branch on POS Orders based on the POS.

+
+
+ +
+
+ +
+
+

+ Branch on Receipt.

+

+ Branch details on Order receipt.

+
+
+ +
+
+ +
+
+

+ Branch Wise Report.

+

+ Customised POS report.

+
+
+ +
+ +
+
+

+ Screenshots +

+
+
+

+ Branch for POS

+ +
+ +
+

+ Branch for POS Sessions

+ +
+ +
+

+ Branch for POS Order

+ +
+ + +
+

+ Branch on Receipt

+ +
+ + +
+

+ Branch wise report

+ +
+ + +
+ + + +
+
+

Suggested Products

+
+ + +
+
+ + + +
+
+
+

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+ +
+
+ + + + + +
+
+
+

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/multi_branch_pos/static/src/js/branch.js b/multi_branch_pos/static/src/js/branch.js new file mode 100644 index 000000000..e42bc5a43 --- /dev/null +++ b/multi_branch_pos/static/src/js/branch.js @@ -0,0 +1,9 @@ + +odoo.define('multi_branch_pos.PosMultiBranch', function (require) { +"use strict"; + +var models = require('point_of_sale.models'); + +models.load_fields('pos.config', ['branch_name', 'email', 'phone', 'website']); + +}); \ No newline at end of file diff --git a/multi_branch_pos/static/src/xml/branch.xml b/multi_branch_pos/static/src/xml/branch.xml new file mode 100644 index 000000000..63e45e6bc --- /dev/null +++ b/multi_branch_pos/static/src/xml/branch.xml @@ -0,0 +1,56 @@ + + + + +
+ +
+
+ +
Branch:
+
+ +
Tel:
+
+ + +
Tel:
+
+
+ +
:
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+ + + + +
+
+ +
+
--------------------------------
+
Served by
+
+
+
+

+
+ +
+
\ No newline at end of file diff --git a/multi_branch_pos/views/branch_pos_config_views.xml b/multi_branch_pos/views/branch_pos_config_views.xml new file mode 100644 index 000000000..ae14163c1 --- /dev/null +++ b/multi_branch_pos/views/branch_pos_config_views.xml @@ -0,0 +1,60 @@ + + + + + pos.config.inherit + pos.config + + +
+
+
+
+
+
+ + + + + + + + + +
+
+ + + view_pos_config_tree_inherit + pos.config + + + + + + + + + + view_pos_config_search.inherit + pos.config + + + + + + + +
+
\ No newline at end of file diff --git a/multi_branch_pos/views/branch_pos_orders_views.xml b/multi_branch_pos/views/branch_pos_orders_views.xml new file mode 100644 index 000000000..8780e632d --- /dev/null +++ b/multi_branch_pos/views/branch_pos_orders_views.xml @@ -0,0 +1,26 @@ + + + + + pos.order.inherit + pos.order + + + + + + + + + + view_pos_order_filter.inherit + pos.order + + + + + + + + + \ No newline at end of file diff --git a/multi_branch_pos/views/branch_pos_session_views.xml b/multi_branch_pos/views/branch_pos_session_views.xml new file mode 100644 index 000000000..29ef54f71 --- /dev/null +++ b/multi_branch_pos/views/branch_pos_session_views.xml @@ -0,0 +1,16 @@ + + + + + pos.session.inherit + pos.session + + + + + + + + + + \ No newline at end of file diff --git a/multi_branch_pos/views/pos_assets.xml b/multi_branch_pos/views/pos_assets.xml new file mode 100644 index 000000000..a2fb2f80a --- /dev/null +++ b/multi_branch_pos/views/pos_assets.xml @@ -0,0 +1,10 @@ + + + +