Browse Source

Nov 15 [ADD] Initial Commit 'multi_branch_pos'

pull/232/head
AjmalCybro 2 years ago
parent
commit
daaff5fb66
  1. 45
      multi_branch_pos/README.rst
  2. 25
      multi_branch_pos/__init__.py
  3. 53
      multi_branch_pos/__manifest__.py
  4. 9
      multi_branch_pos/doc/RELEASE_NOTES.md
  5. 26
      multi_branch_pos/models/__init__.py
  6. 74
      multi_branch_pos/models/account_bank_statement.py
  7. 183
      multi_branch_pos/models/branch_pos_config.py
  8. 56
      multi_branch_pos/models/branch_pos_orders.py
  9. 128
      multi_branch_pos/models/branch_pos_session.py
  10. 1
      multi_branch_pos/report/__init__.py
  11. 23
      multi_branch_pos/report/branch_pos_order_report.py
  12. 14
      multi_branch_pos/report/pos_order_report.xml
  13. 37
      multi_branch_pos/security/pos_security.xml
  14. BIN
      multi_branch_pos/static/description/assets/icons/check.png
  15. BIN
      multi_branch_pos/static/description/assets/icons/chevron.png
  16. BIN
      multi_branch_pos/static/description/assets/icons/cogs.png
  17. BIN
      multi_branch_pos/static/description/assets/icons/consultation.png
  18. BIN
      multi_branch_pos/static/description/assets/icons/ecom-black.png
  19. BIN
      multi_branch_pos/static/description/assets/icons/education-black.png
  20. BIN
      multi_branch_pos/static/description/assets/icons/hotel-black.png
  21. BIN
      multi_branch_pos/static/description/assets/icons/license.png
  22. BIN
      multi_branch_pos/static/description/assets/icons/lifebuoy.png
  23. BIN
      multi_branch_pos/static/description/assets/icons/logo.png
  24. BIN
      multi_branch_pos/static/description/assets/icons/manufacturing-black.png
  25. BIN
      multi_branch_pos/static/description/assets/icons/pos-black.png
  26. BIN
      multi_branch_pos/static/description/assets/icons/puzzle.png
  27. BIN
      multi_branch_pos/static/description/assets/icons/restaurant-black.png
  28. BIN
      multi_branch_pos/static/description/assets/icons/service-black.png
  29. BIN
      multi_branch_pos/static/description/assets/icons/trading-black.png
  30. BIN
      multi_branch_pos/static/description/assets/icons/training.png
  31. BIN
      multi_branch_pos/static/description/assets/icons/update.png
  32. BIN
      multi_branch_pos/static/description/assets/icons/user.png
  33. BIN
      multi_branch_pos/static/description/assets/icons/wrench.png
  34. BIN
      multi_branch_pos/static/description/assets/modules/barcode_image.png
  35. BIN
      multi_branch_pos/static/description/assets/modules/biometric_image.png
  36. BIN
      multi_branch_pos/static/description/assets/modules/export_image.png
  37. BIN
      multi_branch_pos/static/description/assets/modules/login_image.png
  38. BIN
      multi_branch_pos/static/description/assets/modules/payroll_image.png
  39. BIN
      multi_branch_pos/static/description/assets/modules/sale_image.png
  40. BIN
      multi_branch_pos/static/description/assets/screenshots/hero.png
  41. BIN
      multi_branch_pos/static/description/assets/screenshots/pos1.png
  42. BIN
      multi_branch_pos/static/description/assets/screenshots/pos2.png
  43. BIN
      multi_branch_pos/static/description/assets/screenshots/pos3.png
  44. BIN
      multi_branch_pos/static/description/assets/screenshots/pos4.png
  45. BIN
      multi_branch_pos/static/description/assets/screenshots/pos5.png
  46. BIN
      multi_branch_pos/static/description/banner.png
  47. BIN
      multi_branch_pos/static/description/icon.png
  48. 678
      multi_branch_pos/static/description/index.html
  49. 9
      multi_branch_pos/static/src/js/branch.js
  50. 56
      multi_branch_pos/static/src/xml/branch.xml
  51. 60
      multi_branch_pos/views/branch_pos_config_views.xml
  52. 26
      multi_branch_pos/views/branch_pos_orders_views.xml
  53. 16
      multi_branch_pos/views/branch_pos_session_views.xml
  54. 10
      multi_branch_pos/views/pos_assets.xml

45
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 <https://cybrosys.com/>`__
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 <https://cybrosys.com/>`__
Further information
===================
HTML Description: `<static/description/index.html>`__

25
multi_branch_pos/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sayooj A O(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import models
from . import report

53
multi_branch_pos/__manifest__.py

@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sayooj A O(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
{
'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
}

9
multi_branch_pos/doc/RELEASE_NOTES.md

@ -0,0 +1,9 @@
## Module <multi_branch_pos>
#### 09.11.2022
#### Version 15.0.1.0.0
#### ADD
Initial Commit

26
multi_branch_pos/models/__init__.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sayooj A O(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import branch_pos_config
from . import branch_pos_orders
from . import branch_pos_session
from . import account_bank_statement

74
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(<https://www.cybrosys.com>).
# Author: Sayooj A O(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
"""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

183
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(<https://www.cybrosys.com>).
# Author: Sayooj A O(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
"""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

56
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(<https://www.cybrosys.com>).
# Author: Sayooj A O(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
"""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

128
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(<https://www.cybrosys.com>).
# Author: Sayooj A O(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
"""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()

1
multi_branch_pos/report/__init__.py

@ -0,0 +1 @@
from . import branch_pos_order_report

23
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"

14
multi_branch_pos/report/pos_order_report.xml

@ -0,0 +1,14 @@
<odoo>
<data>
<record id="view_report_pos_order_search_inherit" model="ir.ui.view">
<field name="name">pos.order.search.view.inherit</field>
<field name="model">report.pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_report_pos_order_search"/>
<field name="arch" type="xml">
<xpath expr="//search/group" position="inside">
<filter string="Branch" name="Branch" context="{'group_by':'branch_id'}"/>
</xpath>
</field>
</record>
</data>
</odoo>

37
multi_branch_pos/security/pos_security.xml

@ -0,0 +1,37 @@
<odoo>
<data noupdate="1">
<record id="branch_pos_rule" model="ir.rule">
<field name="name">Branch POS Rule</field>
<field name="model_id" ref="model_pos_config"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('branch_id','=',False),('branch_id', 'in', user.branch_ids.ids)]</field>
</record>
</data>
<data noupdate="1">
<record id="branch_pos_order_rule" model="ir.rule">
<field name="name">Branch POS Order Rule</field>
<field name="model_id" ref="model_pos_order"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('branch_id','=',False),('branch_id', 'in', user.branch_ids.ids)]</field>
</record>
</data>
<data noupdate="1">
<record id="branch_pos_session_rule" model="ir.rule">
<field name="name">Branch POS Session Rule</field>
<field name="model_id" ref="model_pos_session"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('branch_id','=',False),('branch_id', 'in', user.branch_ids.ids)]</field>
</record>
</data>
<data noupdate="1">
<record id="branch_pos_report_rule" model="ir.rule">
<field name="name">Branch POS Report Rule</field>
<field name="model_id" ref="model_report_pos_order"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('branch_id','=',False),('branch_id', 'in', user.branch_ids.ids)]</field>
</record>
</data>
</odoo>

BIN
multi_branch_pos/static/description/assets/icons/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
multi_branch_pos/static/description/assets/icons/chevron.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
multi_branch_pos/static/description/assets/icons/cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
multi_branch_pos/static/description/assets/icons/consultation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
multi_branch_pos/static/description/assets/icons/ecom-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
multi_branch_pos/static/description/assets/icons/education-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
multi_branch_pos/static/description/assets/icons/hotel-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
multi_branch_pos/static/description/assets/icons/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
multi_branch_pos/static/description/assets/icons/lifebuoy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
multi_branch_pos/static/description/assets/icons/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
multi_branch_pos/static/description/assets/icons/manufacturing-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
multi_branch_pos/static/description/assets/icons/pos-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
multi_branch_pos/static/description/assets/icons/puzzle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
multi_branch_pos/static/description/assets/icons/restaurant-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

BIN
multi_branch_pos/static/description/assets/icons/service-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
multi_branch_pos/static/description/assets/icons/trading-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
multi_branch_pos/static/description/assets/icons/training.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
multi_branch_pos/static/description/assets/icons/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
multi_branch_pos/static/description/assets/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
multi_branch_pos/static/description/assets/icons/wrench.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
multi_branch_pos/static/description/assets/modules/barcode_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
multi_branch_pos/static/description/assets/modules/biometric_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
multi_branch_pos/static/description/assets/modules/export_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
multi_branch_pos/static/description/assets/modules/login_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
multi_branch_pos/static/description/assets/modules/payroll_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
multi_branch_pos/static/description/assets/modules/sale_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
multi_branch_pos/static/description/assets/screenshots/hero.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
multi_branch_pos/static/description/assets/screenshots/pos1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
multi_branch_pos/static/description/assets/screenshots/pos2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
multi_branch_pos/static/description/assets/screenshots/pos3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
multi_branch_pos/static/description/assets/screenshots/pos4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
multi_branch_pos/static/description/assets/screenshots/pos5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
multi_branch_pos/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
multi_branch_pos/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

678
multi_branch_pos/static/description/index.html

@ -0,0 +1,678 @@
<div class="container" style="padding: 1rem !important; margin-bottom: 1rem !important;">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
style="border-bottom: 1px solid #d5d5d5;">
<div class="my-3">
<img src="./assets/icons/logo.png" style="width: auto !important; height: 40px !important;">
</div>
<div class="my-3 d-flex align-items-center">
<div
style="background-color: #7C7BAD !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Community
</div>
<div
style="background-color: #875A7B !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
</div>
</div>
</div>
</div>
<div class="container" style="padding: 0rem 1.5rem 4rem !important">
<div class="row" style="height: 900px !important;">
<div class="col-sm-12 col-md-12 col-lg-12"
style="padding: 4rem 1rem !important; background-color: #714B67 !important; height: 600px !important; border-radius: 20px !important;">
<h1
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #FFFFFF !important; font-size: 3.5rem !important; text-align: center !important;">
Multi Branch Operations Setup for Odoo POS</h1>
<p
style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #FFFFFF !important; font-size: 1.4rem !important; text-align: center !important;">
Multi Branch Operations Setup for Odoo POS
</p>
<img src="./assets/screenshots/hero.png" class="img-responsive" width="100%" height="auto" />
</div>
</div>
<div class="row">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin-bottom: 2rem !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-compass mr-2"></i>Explore this module
</h2>
</div>
<div class="col-md-6">
<a href="#overview" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Overview</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
Learn more about this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#configuration" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Configuration</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
View configurations for this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#features" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Features</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
View features of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#screenshots" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Screenshots</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
See key screenshots of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
</div>
<div class="row" id="overview">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-pie-chart mr-2"></i>Overview
</h2>
</div>
<div class="col-mg-12 pl-3">
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
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. </p>
</div>
</div>
<div class="row" id="configuration">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-pie-chart mr-2"></i>Configuration
</h2>
</div>
<div class="col-mg-12 pl-3">
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
No additional configuration required</p>
</div>
</div>
<div class="row" id="features">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-star mr-2"></i>Features
</h2>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Community &amp; Enterprise Support</h4>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Available in Odoo 14.0 Community and Enterprise.</p>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch for POS.</h4>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Added Branch for POS Configuration.</p>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch for POS Session.</h4>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Branch added for Session based on the POS.</p>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch for POS Orders.</h4>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Branch on POS Orders based on the POS.</p>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch on Receipt.</h4>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Branch details on Order receipt.</p>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch Wise Report.</h4>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Customised POS report.</p>
</div>
</div>
</div>
<div class="row" id="screenshots">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-image mr-2"></i>Screenshots
</h2>
</div>
<div class="col-lg-12 my-2">
<h4 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch for POS</h4>
<img src="assets/screenshots/pos1.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch for POS Sessions</h4>
<img src="assets/screenshots/pos2.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch for POS Order</h4>
<img src="assets/screenshots/pos3.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch on Receipt</h4>
<img src="assets/screenshots/pos4.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Branch wise report</h4>
<img src="assets/screenshots/pos5.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
</div>
<!-- SUGGESTED PRODUCTS -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="color: #212529 !important;">Suggested Products</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;" />
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active" style="min-height:0px">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/hr_payroll_community/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/payroll_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/product_barcode/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/barcode_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/export_stockinfo_xls/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/export_image.png">
</div>
</a>
</div>
</div>
<div class="carousel-item" style="min-height:0px">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/sale_discount_total/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/sale_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/login_user_detail/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/login_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/hr_zk_attendance/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/biometric_image.png">
</div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev"
style="left:-25px;width: 35px;color: #000;"> <span class="carousel-control-prev-icon"><i
class="fa fa-chevron-left" style="font-size:24px"></i></span> </a> <a
class="carousel-control-next" href="#demo1" data-slide="next"
style="right:-25px;width: 35px;color: #000;">
<span class="carousel-control-next-icon"><i class="fa fa-chevron-right"
style="font-size:24px"></i></span>
</a>
</div>
</div>
</div>
<!-- END OF SUGGESTED PRODUCTS -->
<!-- OUR SERVICES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Services</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;" />
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/cogs.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Customization</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/wrench.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/lifebuoy.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Support</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/user.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Hire
Odoo
Developer</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/puzzle.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Integration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/update.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Migration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/consultation.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Consultancy</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/training.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/license.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Licensing Consultancy</h6>
</div>
</div>
</section>
<!-- END OF END OF OUR SERVICES -->
<!-- OUR INDUSTRIES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Industries</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;" />
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/trading-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Trading
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easily procure
and
sell your products</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/pos-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
POS
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easy
configuration
and convivial experience</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/education-black.png" class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Education
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
A platform for
educational management</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/manufacturing-black.png" class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Plan, track and
schedule your operations</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/ecom-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
E-commerce &amp; Website
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Mobile
friendly,
awe-inspiring product pages</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/service-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Service Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Keep track of
services and invoice</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/restaurant-black.png" class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Restaurant
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Run your bar or
restaurant methodically</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/hotel-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Hotel Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
An
all-inclusive
hotel management application</p>
</div>
</div>
</div>
</section>
<!-- END OF END OF OUR INDUSTRIES -->
<!-- FOOTER -->
<!-- Footer Section -->
<section class="container" style="margin: 5rem auto 2rem;">
<div class="row" style="max-width:1540px;">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Need Help?</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;" />
</div>
</div>
<!-- Contact Cards -->
<div class="row d-flex justify-content-center align-items-center"
style="max-width:1540px; margin: 0 auto 2rem auto;">
<div class="col-lg-12" style="padding: 0rem 3rem 2rem; border-radius: 10px; margin-right: 3rem; ">
<div class="row mt-4">
<div class="col-lg-6">
<a href="mailto:odoo@cybrosys.com" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #4d4d4d; color: #FFF; border-radius: 4px;"><i
class="fa fa-envelope mr-2"></i>odoo@cybrosys.com</a>
</div>
<div class="col-lg-6">
<a href="https://api.whatsapp.com/send?phone=918606827707" target="_blank"
class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #25D366; color: #FFF; border-radius: 4px;"><i
class="fa fa-whatsapp mr-2"></i>+91 86068 27707</a>
</div>
</div>
</div>
</div>
<!-- End of Contact Cards -->
</section>
<!-- Footer -->
<section class="oe_container" style="padding: 2rem 3rem 1rem;">
<div class="row" style="max-width:1540px; margin: 0 auto; margin-right: 3rem; ">
<!-- Logo -->
<div class="col-lg-12 d-flex justify-content-center align-items-center" style="margin-top: 3rem;">
<img src="https://www.cybrosys.com/images/logo.png" width="200px" height="auto" />
</div>
<!-- End of Logo -->
<div class="col-lg-12">
<hr
style="margin-top: 3rem;background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;">
<!-- End of Footer Section -->
</div>
</div>
</section>
<!-- END OF FOOTER -->
</div>

9
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']);
});

56
multi_branch_pos/static/src/xml/branch.xml

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
<xpath expr="//div[hasclass('pos-receipt-contact')]" position="replace">
<div class="pos-receipt-contact">
<t t-if="receipt.company.contact_address">
<div><t t-esc="receipt.company.contact_address" /></div>
</t>
<t t-if="env.pos.config.branch_id">
<div>Branch: <t t-esc="env.pos.config.branch_name" /></div>
</t>
<t t-if="env.pos.config.phone">
<div>Tel:<t t-esc="env.pos.config.phone" /></div>
</t>
<t t-else="else">
<t t-if="receipt.company.phone">
<div>Tel:<t t-esc="receipt.company.phone" /></div>
</t>
</t>
<t t-if="receipt.company.vat">
<div><t t-esc="receipt.company.vat_label"/>:<t t-esc="receipt.company.vat" /></div>
</t>
<t t-if="env.pos.config.email">
<div><t t-esc="env.pos.config.email" /></div>
</t>
<t t-else="else">
<t t-if="receipt.company.email">
<div><t t-esc="receipt.company.email" /></div>
</t>
</t>
<t t-if="env.pos.config.website">
<div><t t-esc="env.pos.config.website" /></div>
</t>
<t t-else="else">
<t t-if="receipt.company.website">
<div><t t-esc="receipt.company.website" /></div>
</t>
</t>
<t t-if="receipt.header_html">
<t t-raw="receipt.header_html" />
</t>
<t t-if="!receipt.header_html and receipt.header">
<div><t t-esc="receipt.header" /></div>
</t>
<t t-if="receipt.cashier">
<div class="cashier">
<div>--------------------------------</div>
<div>Served by <t t-esc="receipt.cashier" /></div>
</div>
</t>
</div>
<br /><br />
</xpath>
</t>
</templates>

60
multi_branch_pos/views/branch_pos_config_views.xml

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="pos_config_view_form_inherit" model="ir.ui.view">
<field name="name">pos.config.inherit</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml">
<div id="company" position="after">
<div id="branch_id" class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="branch_id"/>
<field name="branch_id" options="{'no_create': True}"
domain="[('company_id', '=', company_id), ('id', 'in', allowed_branch_ids)]"/>
<div><field name="branch_name" invisible="1" readonly="1"/></div>
<field name="allowed_branch_ids" invisible="1"/>
</div>
</div>
</div>
<xpath expr="//field[@name='picking_type_id']" position="replace">
<field name="picking_type_id" required="1"
domain="[('code', '=', 'outgoing'), '|', ('branch_id', '=', branch_id), ('branch_id', '=', False)]"/>
</xpath>
<xpath expr="//field[@name='journal_id']" position="replace">
<field name="journal_id" required="1"
domain="[('type', 'in', ('general', 'sale')), '|', ('branch_id', '=', branch_id), ('branch_id', '=', False)]"
context="{'default_company_id': company_id, 'default_type': 'sale'}"/>
</xpath>
<xpath expr="//field[@name='invoice_journal_id']" position="replace">
<field name="invoice_journal_id" required="1"
domain="[('type', '=', 'sale'), '|', ('branch_id', '=', branch_id), ('branch_id', '=', False)]"
attrs="{'required': [('module_account', '=', True)]}"
context="{'default_company_id': company_id, 'default_type': 'sale'}"/>
</xpath>
</field>
</record>
<record id="view_pos_config_tree_inherit" model="ir.ui.view">
<field name="name">view_pos_config_tree_inherit</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.view_pos_config_tree"/>
<field name="arch" type="xml">
<field name="company_id" position="after">
<field name="branch_id" optional="show"/>
</field>
</field>
</record>
<record id="view_pos_config_search_inherit" model="ir.ui.view">
<field name="name">view_pos_config_search.inherit</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.view_pos_config_search"/>
<field name="arch" type="xml">
<xpath expr="//search" position="inside">
<filter string="Branch" name="Branch" context="{'group_by':'branch_id'}"/>
</xpath>
</field>
</record>
</data>
</odoo>

26
multi_branch_pos/views/branch_pos_orders_views.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="view_pos_pos_form_inherit" model="ir.ui.view">
<field name="name">pos.order.inherit</field>
<field name="model">pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='extra']//field[@name='company_id']" position="after">
<field name="branch_id" options="{'no_create': True}"/>
</xpath>
</field>
</record>
<record id="view_pos_order_filter_inherit" model="ir.ui.view">
<field name="name">view_pos_order_filter.inherit</field>
<field name="model">pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_pos_order_filter"/>
<field name="arch" type="xml">
<xpath expr="//search/group" position="inside">
<filter string="Branch" name="Branch" context="{'group_by':'branch_id'}"/>
</xpath>
</field>
</record>
</data>
</odoo>

16
multi_branch_pos/views/branch_pos_session_views.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="view_pos_session_form_inherit" model="ir.ui.view">
<field name="name">pos.session.inherit</field>
<field name="model">pos.session</field>
<field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='stop_at']" position="after">
<field name="branch_id" options="{'no_create': True}"/>
</xpath>
</field>
</record>
</data>
</odoo>

10
multi_branch_pos/views/pos_assets.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/multi_branch_pos/static/src/js/branch.js" />
</xpath>
</template>
</data>
</odoo>
Loading…
Cancel
Save