diff --git a/multi_branch_pos/README.rst b/multi_branch_pos/README.rst new file mode 100644 index 000000000..31ba46059 --- /dev/null +++ b/multi_branch_pos/README.rst @@ -0,0 +1,58 @@ +.. 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 + +Multiple Branch Setup for POS +================ +This module helps you to link POS with Company Branches. + +Configuration +============= +* No additional configurations needed + +License +------- +Affero General Public License v3.0 (AGPL v3) +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + + +License +------- +Affero General Public License v3.0 (AGPL v3) +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + + +Credits +------- +* Developers: Sagarika@cybrosys , Jumana@cybrosys + version 14: Sagarika@cybrosys + version 15: Sagarika@cybrosys + version 16: Jumana@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..6e2f05ba3 --- /dev/null +++ b/multi_branch_pos/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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..13cdc5442 --- /dev/null +++ b/multi_branch_pos/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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': "16.0.1.0.0", + 'summary': """ Multiple Branch Operation Setup for Odoo POS""", + 'description': """ Manages Multiple Branch Operation setup for Odoo Point of + sale.""", + 'author': "Cybrosys Techno Solutions", + 'company': "Cybrosys Techno Solutions", + 'maintainer': "Cybrosys Techno Solutions", + 'website': "https://cybrosys.com/", + 'category': 'Point of sale', + 'depends': ['base', 'multi_branch_base', 'point_of_sale'], + 'data': [ + 'security/multi_branch_pos_security.xml', + 'views/pos_config_views.xml', + 'views/pos_orders_views.xml', + 'views/pos_session_views.xml', + 'report/pos_order_report_views.xml' + ], + 'images': ['static/description/banner.png'], + 'assets': { + 'point_of_sale.assets': [ + 'multi_branch_pos/static/src/xml/branch.xml', + ], + }, + 'license': "AGPL-3", + 'installable': True, + 'auto_install': False, + '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..bfe3123c3 --- /dev/null +++ b/multi_branch_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 09.02.2023 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Multiple Branch Setup for POS diff --git a/multi_branch_pos/models/__init__.py b/multi_branch_pos/models/__init__.py new file mode 100644 index 000000000..42d2e2cc8 --- /dev/null +++ b/multi_branch_pos/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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 pos_config +from . import pos_orders +from . import 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..8f2e61ead --- /dev/null +++ b/multi_branch_pos/models/account_bank_statement.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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 account.bank.statement model to add new branch field""" + _inherit = 'account.bank.statement' + + branch_id = fields.Many2one('res.branch', string='Branch', + help='Branches allowed') + + 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: + 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 diff --git a/multi_branch_pos/models/pos_config.py b/multi_branch_pos/models/pos_config.py new file mode 100644 index 000000000..d57e6eaf0 --- /dev/null +++ b/multi_branch_pos/models/pos_config.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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 api, fields, models + + +class PointOfSaleBranch(models.Model): + """inherit pos config to add new branch field""" + _inherit = 'pos.config' + + def _default_picking_type_id(self): + """function to set default picking type""" + domain = [('company_id', '=', self.env.company.id)] + if self.env.user.branch_id: + domain += ['|', ('branch_id', '=', False), + ('branch_id', '=', self.env.user.branch_id.id)] + else: + domain += [('branch_id', '=', False)] + warehouse = self.env['stock.warehouse'].search(domain, limit=1) + return warehouse.pos_type_id.id if warehouse else False + + def _default_sale_journal(self): + """function 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): + """function 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) + + branch_id = fields.Many2one('res.branch', string='Branch', store=True, + readonly=False, compute='_compute_branch', + help='Branches allowed') + branch_name = fields.Char(string="Branch Name", store=True, + help='Branch name', + related='branch_id.name') + email = fields.Char(related='branch_id.email', string="Email", + help='Email of specific branch', store=True) + phone = fields.Char(related='branch_id.phone', string="Phone", + help='Phone of specific branch', store=True) + website = fields.Char(related='branch_id.website', string="Website", + help='Website of specific branch', store=True) + allowed_branch_ids = fields.Many2many('res.branch', + string="Allowed Branches", + help='If set, Acts as default or ' + 'allowed branches', + compute='_compute_allowed_branch_ids') + picking_type_id = fields.Many2one( + 'stock.picking.type', + string='Operation Type', + default=_default_picking_type_id, + help='Specific stock picking type of the branch', + 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.depends('company_id') + def _compute_allowed_branch_ids(self): + """method to compute allowed branches""" + for pos in self: + pos.allowed_branch_ids = self.env.user.branch_ids.ids + + @api.depends('company_id') + def _compute_branch(self): + """method to compute default branch""" + 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 + + @api.onchange('branch_id') + def onchange_branch(self): + """on setting a branch arrange the journals of corresponding branch.""" + for pos in self: + domain = [('branch_id', 'in', [pos.branch_id.id, False]), + ('company_id', '=', self.env.company.id)] + picking = self.env['stock.warehouse'].search(domain, limit=1) + sales_journal_domain = [ + ('branch_id', 'in', + [pos.branch_id.id, False]), + ('company_id', '=', self.env.company.id), + ('type', 'in', ('sale', 'general')), + ('code', 'ilike', 'POSS')] + sales_journal = self.env['account.journal'].search( + sales_journal_domain, limit=1) + invoice_journal_domain = [('branch_id', 'in', + [pos.branch_id.id, False]), + ('company_id', '=', self.env.company.id), + ('type', '=', 'sale') + ] + invoice_journal = self.env['account.journal'].search( + invoice_journal_domain, 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/pos_orders.py b/multi_branch_pos/models/pos_orders.py new file mode 100644 index 000000000..eb895632c --- /dev/null +++ b/multi_branch_pos/models/pos_orders.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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 odoo import fields, models + + +_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', + related='session_id.branch_id', + string='Branch', help='Branches allowed', + store=True) diff --git a/multi_branch_pos/models/pos_session.py b/multi_branch_pos/models/pos_session.py new file mode 100644 index 000000000..a9dd0c5a5 --- /dev/null +++ b/multi_branch_pos/models/pos_session.py @@ -0,0 +1,153 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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 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", help='Allowed Branches', + 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): + """creating split of account payments""" + 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): + """creating combined account payment""" + 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): + """ Creating different account moves for split payment method""" + 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..eb9eb220c --- /dev/null +++ b/multi_branch_pos/report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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 pos_order_report diff --git a/multi_branch_pos/report/pos_order_report.py b/multi_branch_pos/report/pos_order_report.py new file mode 100644 index 000000000..425a3f586 --- /dev/null +++ b/multi_branch_pos/report/pos_order_report.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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 odoo import fields, models + + +class PosReport(models.Model): + """inherited report.pos.order""" + _inherit = "report.pos.order" + + branch_id = fields.Many2one('res.branch', string='Branch', + help='Allowed Branches', readonly=True) + + def _select(self): + """override select method to add branch""" + return super(PosReport, self)._select() + ", s.branch_id as branch_id" + + def _group_by(self): + """override group by method""" + return super(PosReport, self)._group_by() + ", s.branch_id" diff --git a/multi_branch_pos/report/pos_order_report_views.xml b/multi_branch_pos/report/pos_order_report_views.xml new file mode 100644 index 000000000..4312c41c7 --- /dev/null +++ b/multi_branch_pos/report/pos_order_report_views.xml @@ -0,0 +1,16 @@ + + + + + report.pos.order.view.search.inherit.multi.branch.pos + report.pos.order + + + + + + + + diff --git a/multi_branch_pos/security/multi_branch_pos_security.xml b/multi_branch_pos/security/multi_branch_pos_security.xml new file mode 100644 index 000000000..eba2fcb7c --- /dev/null +++ b/multi_branch_pos/security/multi_branch_pos_security.xml @@ -0,0 +1,33 @@ + + + + + + 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/module01.png b/multi_branch_pos/static/description/assets/modules/module01.png new file mode 100644 index 000000000..a9936f593 Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/module01.png differ diff --git a/multi_branch_pos/static/description/assets/modules/module02.png b/multi_branch_pos/static/description/assets/modules/module02.png new file mode 100644 index 000000000..1a9e2cbd7 Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/module02.png differ diff --git a/multi_branch_pos/static/description/assets/modules/module03.png b/multi_branch_pos/static/description/assets/modules/module03.png new file mode 100644 index 000000000..d3d28e08b Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/module03.png differ diff --git a/multi_branch_pos/static/description/assets/modules/module04.png b/multi_branch_pos/static/description/assets/modules/module04.png new file mode 100644 index 000000000..5297b364a Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/module04.png differ diff --git a/multi_branch_pos/static/description/assets/modules/module05.png b/multi_branch_pos/static/description/assets/modules/module05.png new file mode 100644 index 000000000..2263f673e Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/module05.png differ diff --git a/multi_branch_pos/static/description/assets/modules/module06.png b/multi_branch_pos/static/description/assets/modules/module06.png new file mode 100644 index 000000000..0b8c68699 Binary files /dev/null and b/multi_branch_pos/static/description/assets/modules/module06.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-001.png b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-001.png new file mode 100644 index 000000000..ffc7f359e Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-001.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-002.png b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-002.png new file mode 100644 index 000000000..f9f63c937 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-002.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-003.png b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-003.png new file mode 100644 index 000000000..95a64e7f9 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-003.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-004.png b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-004.png new file mode 100644 index 000000000..2231ce850 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-004.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-005.png b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-005.png new file mode 100644 index 000000000..07e6115f5 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-005.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-006.png b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-006.png new file mode 100644 index 000000000..3e26d454c Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-006.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-007.png b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-007.png new file mode 100644 index 000000000..62cdce2ea Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-007.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-008.png b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-008.png new file mode 100644 index 000000000..12228cbe0 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/MPOS-SC-008.png differ diff --git a/multi_branch_pos/static/description/assets/screenshots/hero.gif b/multi_branch_pos/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..c15183749 Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/hero.gif differ diff --git a/multi_branch_pos/static/description/assets/screenshots/poshero.png b/multi_branch_pos/static/description/assets/screenshots/poshero.png new file mode 100644 index 000000000..bba9298ca Binary files /dev/null and b/multi_branch_pos/static/description/assets/screenshots/poshero.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..8fefb76d4 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..414be112c 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..bb49cd5a9 --- /dev/null +++ b/multi_branch_pos/static/description/index.html @@ -0,0 +1,726 @@ +
+ + +
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+ +
+
+
+
+ + + +
+
+
+

+ Multiple Branch Setup for 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 and Odoo 15.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 Creation

+

+ Administrator can create Branches for the + company from Settings -> Users & Companies -> Branches -> Create +

+ +
+ +
+

+ Allowed & Default Branch

+

+ Allowed branches and default branch can be set for each user. + The showing Branches will be based on the allowed Companies + for the particular user +

+ +
+ +
+

+ Branch for POS

+ +
+ +
+

+ Branch on Receipt

+ +
+ +
+

+ Branch for POS Order

+ + +
+ + +
+

+ Branch for POS Sessions +

+ +
+ + +
+

+ 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/xml/branch.xml b/multi_branch_pos/static/src/xml/branch.xml new file mode 100644 index 000000000..7bcf971a7 --- /dev/null +++ b/multi_branch_pos/static/src/xml/branch.xml @@ -0,0 +1,12 @@ + + + + + + +
Branch:
+
+
+
+
diff --git a/multi_branch_pos/views/pos_config_views.xml b/multi_branch_pos/views/pos_config_views.xml new file mode 100644 index 000000000..ec95af567 --- /dev/null +++ b/multi_branch_pos/views/pos_config_views.xml @@ -0,0 +1,75 @@ + + + + + pos.config.view.form.inherit.multi.branch.pos + pos.config + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + pos.config.view.tree.inherit.multi.branch.pos + pos.config + + + + + + + + + + pos.config.view.search.inherit.multi.branch.pos + pos.config + + + + + + + +
\ No newline at end of file diff --git a/multi_branch_pos/views/pos_orders_views.xml b/multi_branch_pos/views/pos_orders_views.xml new file mode 100644 index 000000000..4bbf29b18 --- /dev/null +++ b/multi_branch_pos/views/pos_orders_views.xml @@ -0,0 +1,38 @@ + + + + + pos.order.view.form.inherit.multi.branch.pos + pos.order + + + + + + + + + + pos.order.view.filter.inherit.multi.branch.pos + pos.order + + + + + + + + + + pos.order.view.tree.inherit.multi.branch.pos + pos.order + + + + + + + + \ No newline at end of file diff --git a/multi_branch_pos/views/pos_session_views.xml b/multi_branch_pos/views/pos_session_views.xml new file mode 100644 index 000000000..9cfe2552c --- /dev/null +++ b/multi_branch_pos/views/pos_session_views.xml @@ -0,0 +1,14 @@ + + + + + pos.session.view.form.inherit.multi.branch.pos + pos.session + + + + + + + + \ No newline at end of file