Browse Source

[ADD] Initial Commit 'sale_discount_total'

pull/195/head
Ajmal Cybro 4 years ago
parent
commit
595cad119f
  1. 41
      sale_discount_total/README.rst
  2. 24
      sale_discount_total/__init__.py
  3. 55
      sale_discount_total/__manifest__.py
  4. 9
      sale_discount_total/doc/RELEASE_NOTES.md
  5. 25
      sale_discount_total/models/__init__.py
  6. 176
      sale_discount_total/models/account_invoice.py
  7. 82
      sale_discount_total/models/discount_approval.py
  8. 98
      sale_discount_total/models/sale.py
  9. 23
      sale_discount_total/reports/__init__.py
  10. 35
      sale_discount_total/reports/invoice_report.py
  11. 36
      sale_discount_total/reports/sale_report.py
  12. BIN
      sale_discount_total/static/description/assets/icons/check.png
  13. BIN
      sale_discount_total/static/description/assets/icons/chevron.png
  14. BIN
      sale_discount_total/static/description/assets/icons/cogs.png
  15. BIN
      sale_discount_total/static/description/assets/icons/consultation.png
  16. BIN
      sale_discount_total/static/description/assets/icons/ecom-black.png
  17. BIN
      sale_discount_total/static/description/assets/icons/education-black.png
  18. BIN
      sale_discount_total/static/description/assets/icons/hotel-black.png
  19. BIN
      sale_discount_total/static/description/assets/icons/license.png
  20. BIN
      sale_discount_total/static/description/assets/icons/lifebuoy.png
  21. BIN
      sale_discount_total/static/description/assets/icons/logo.png
  22. BIN
      sale_discount_total/static/description/assets/icons/manufacturing-black.png
  23. BIN
      sale_discount_total/static/description/assets/icons/pos-black.png
  24. BIN
      sale_discount_total/static/description/assets/icons/puzzle.png
  25. BIN
      sale_discount_total/static/description/assets/icons/restaurant-black.png
  26. BIN
      sale_discount_total/static/description/assets/icons/service-black.png
  27. BIN
      sale_discount_total/static/description/assets/icons/trading-black.png
  28. BIN
      sale_discount_total/static/description/assets/icons/training.png
  29. BIN
      sale_discount_total/static/description/assets/icons/update.png
  30. BIN
      sale_discount_total/static/description/assets/icons/user.png
  31. BIN
      sale_discount_total/static/description/assets/icons/wrench.png
  32. BIN
      sale_discount_total/static/description/assets/modules/approval_image.png
  33. BIN
      sale_discount_total/static/description/assets/modules/budget_image.png
  34. BIN
      sale_discount_total/static/description/assets/modules/export_image.png
  35. BIN
      sale_discount_total/static/description/assets/modules/magento_image.png
  36. BIN
      sale_discount_total/static/description/assets/modules/pos_image.png
  37. BIN
      sale_discount_total/static/description/assets/modules/shopify_image.png
  38. BIN
      sale_discount_total/static/description/assets/screenshots/hero.png
  39. BIN
      sale_discount_total/static/description/assets/screenshots/screenshot-1.png
  40. BIN
      sale_discount_total/static/description/assets/screenshots/screenshot-2.png
  41. BIN
      sale_discount_total/static/description/assets/screenshots/screenshot-3.png
  42. BIN
      sale_discount_total/static/description/assets/screenshots/screenshot-4.png
  43. BIN
      sale_discount_total/static/description/banner.png
  44. BIN
      sale_discount_total/static/description/cybro_logo.png
  45. BIN
      sale_discount_total/static/description/icon.png
  46. BIN
      sale_discount_total/static/description/images/approval.png
  47. BIN
      sale_discount_total/static/description/images/banner_lifeline_for_task.jpeg
  48. BIN
      sale_discount_total/static/description/images/banner_project_report_xls_pdf.png
  49. BIN
      sale_discount_total/static/description/images/banner_project_status_report.png
  50. BIN
      sale_discount_total/static/description/images/banner_subtask.jpeg
  51. BIN
      sale_discount_total/static/description/images/banner_task_deadline_reminder.jpeg
  52. BIN
      sale_discount_total/static/description/images/banner_task_statusbar.jpeg
  53. BIN
      sale_discount_total/static/description/images/checked.png
  54. BIN
      sale_discount_total/static/description/images/customer invoice.png
  55. BIN
      sale_discount_total/static/description/images/customer _invoice-1.png
  56. BIN
      sale_discount_total/static/description/images/cybrosys.png
  57. BIN
      sale_discount_total/static/description/images/sale order.png
  58. BIN
      sale_discount_total/static/description/images/settings.png
  59. 602
      sale_discount_total/static/description/index.html
  60. 41
      sale_discount_total/views/account_invoice_view.xml
  61. 20
      sale_discount_total/views/invoice_report.xml
  62. 33
      sale_discount_total/views/res_config_view.xml
  63. 21
      sale_discount_total/views/sale_order_report.xml
  64. 53
      sale_discount_total/views/sale_view.xml

41
sale_discount_total/README.rst

@ -0,0 +1,41 @@
Sale Discount on Total Amount
=============================
Discount on Total in Sale and Invoice With Discount Limit and Approval
Configuration
=============
* No additional configurations needed
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
* Developer: Faslu Rahman @cybrosys
* V14: Muhammed P @cybrosys
* V15: Sreerag E @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>`__

24
sale_discount_total/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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 reports

55
sale_discount_total/__manifest__.py

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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': 'Sale Discount on Total Amount',
'version': '15.0.1.0.0',
'category': 'Sales Management',
'live_test_url': 'https://www.youtube.com/watch?v=CigmHe9iC4s&feature=youtu.be',
'summary': "Discount on Total in Sale and Invoice With Discount Limit and Approval",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com',
'description': """
Sale Discount for Total Amount
=======================
Module to manage discount on total amount in Sale.
as an specific amount or percentage
""",
'depends': ['sale',
'account', 'delivery'
],
'data': [
'views/sale_view.xml',
'views/account_invoice_view.xml',
'views/invoice_report.xml',
'views/sale_order_report.xml',
'views/res_config_view.xml',
],
'images': ['static/description/banner.png'],
'license': 'AGPL-3',
'application': True,
'installable': True,
'auto_install': False,
}

9
sale_discount_total/doc/RELEASE_NOTES.md

@ -0,0 +1,9 @@
## Module <sale_discount_total>
#### 10.09.2021
#### Version 15.0.1.0.0
#### ADD
Initial commit for Sale Discount On Total Amount

25
sale_discount_total/models/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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 sale
from . import account_invoice
from . import discount_approval

176
sale_discount_total/models/account_invoice.py

@ -0,0 +1,176 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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 odoo import api, fields, models
class AccountInvoice(models.Model):
_inherit = "account.move"
@api.depends(
'line_ids.matched_debit_ids.debit_move_id.move_id.line_ids.amount_residual',
'line_ids.matched_debit_ids.debit_move_id.move_id.line_ids.amount_residual_currency',
'line_ids.matched_credit_ids.credit_move_id.move_id.line_ids.amount_residual',
'line_ids.matched_credit_ids.credit_move_id.move_id.line_ids.amount_residual_currency',
'line_ids.debit',
'line_ids.credit',
'line_ids.currency_id',
'line_ids.amount_currency',
'line_ids.amount_residual',
'line_ids.amount_residual_currency',
'line_ids.payment_id.state',
'line_ids.full_reconcile_id')
def _compute_amount(self):
for move in self:
if move.payment_state == 'invoicing_legacy':
# invoicing_legacy state is set via SQL when setting setting field
# invoicing_switch_threshold (defined in account_accountant).
# The only way of going out of this state is through this setting,
# so we don't recompute it here.
move.payment_state = move.payment_state
continue
total_untaxed = 0.0
total_untaxed_currency = 0.0
total_tax = 0.0
total_tax_currency = 0.0
total_to_pay = 0.0
total_residual = 0.0
total_residual_currency = 0.0
total = 0.0
total_currency = 0.0
currencies = set()
for line in move.line_ids:
if line.currency_id:
currencies.add(line.currency_id)
if move.is_invoice(include_receipts=True):
# === Invoices ===
if not line.exclude_from_invoice_tab:
# Untaxed amount.
total_untaxed += line.balance
total_untaxed_currency += line.amount_currency
total += line.balance
total_currency += line.amount_currency
elif line.tax_line_id:
# Tax amount.
total_tax += line.balance
total_tax_currency += line.amount_currency
total += line.balance
total_currency += line.amount_currency
elif line.account_id.user_type_id.type in ('receivable', 'payable'):
# Residual amount.
total_to_pay += line.balance
total_residual += line.amount_residual
total_residual_currency += line.amount_residual_currency
else:
# === Miscellaneous journal entry ===
if line.debit:
total += line.balance
total_currency += line.amount_currency
if move.move_type == 'entry' or move.is_outbound():
sign = 1
else:
sign = -1
if move.discount_type == 'percent':
move.amount_discount = sum((line.quantity * line.price_unit * line.discount) / 100 for line in move.invoice_line_ids)
else:
move.amount_discount = move.discount_rate
move.amount_untaxed = sign * (total_untaxed_currency if len(currencies) == 1 else total_untaxed)
move.amount_tax = sign * (total_tax_currency if len(currencies) == 1 else total_tax)
move.amount_total = sign * (total_currency if len(currencies) == 1 else total)
move.amount_residual = -sign * (total_residual_currency if len(currencies) == 1 else total_residual)
move.amount_untaxed_signed = -total_untaxed
move.amount_tax_signed = -total_tax
move.amount_total_signed = abs(total) if move.move_type == 'entry' else -total
move.amount_residual_signed = total_residual
currency = len(currencies) == 1 and currencies.pop() or move.company_id.currency_id
# Compute 'payment_state'.
new_pmt_state = 'not_paid' if move.move_type != 'entry' else False
if move.is_invoice(include_receipts=True) and move.state == 'posted':
if currency.is_zero(move.amount_residual):
if all(payment.is_matched for payment in move._get_reconciled_payments()):
new_pmt_state = 'paid'
else:
new_pmt_state = move._get_invoice_in_payment_state()
elif currency.compare_amounts(total_to_pay, total_residual) != 0:
new_pmt_state = 'partial'
if new_pmt_state == 'paid' and move.move_type in ('in_invoice', 'out_invoice', 'entry'):
reverse_type = move.move_type == 'in_invoice' and 'in_refund' or move.move_type == 'out_invoice' and 'out_refund' or 'entry'
reverse_moves = self.env['account.move'].search(
[('reversed_entry_id', '=', move.id), ('state', '=', 'posted'), ('move_type', '=', reverse_type)])
# We only set 'reversed' state in cas of 1 to 1 full reconciliation with a reverse entry; otherwise, we use the regular 'paid' state
reverse_moves_full_recs = reverse_moves.mapped('line_ids.full_reconcile_id')
if reverse_moves_full_recs.mapped('reconciled_line_ids.move_id').filtered(lambda x: x not in (
reverse_moves + reverse_moves_full_recs.mapped('exchange_move_id'))) == move:
new_pmt_state = 'reversed'
move.payment_state = new_pmt_state
discount_type = fields.Selection([('percent', 'Percentage'), ('amount', 'Amount')], string='Discount Type',
readonly=True, states={'draft': [('readonly', False)]}, default='percent')
discount_rate = fields.Float('Discount Amount', digits=(16, 2), readonly=True,
states={'draft': [('readonly', False)]})
amount_discount = fields.Monetary(string='Discount', store=True, readonly=True, compute='_compute_amount',
track_visibility='always')
@api.onchange('discount_type', 'discount_rate', 'invoice_line_ids')
def supply_rate(self):
for inv in self:
if inv.discount_type == 'percent':
for line in inv.line_ids:
line.discount = inv.discount_rate
line._onchange_price_subtotal()
else:
total = discount = 0.0
for line in inv.invoice_line_ids:
total += (line.quantity * line.price_unit)
if inv.discount_rate != 0:
discount = (inv.discount_rate / total) * 100
else:
discount = inv.discount_rate
for line in inv.line_ids:
line.discount = discount
line._onchange_price_subtotal()
inv._compute_tax_totals_json()
#
def button_dummy(self):
self.supply_rate()
return True
class AccountInvoiceLine(models.Model):
_inherit = "account.move.line"
discount = fields.Float(string='Discount (%)', digits=(16, 20), default=0.0)

82
sale_discount_total/models/discount_approval.py

@ -0,0 +1,82 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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 odoo import api, fields, models
class sale_discount(models.Model):
_inherit = 'sale.order'
state = fields.Selection([
('draft', 'Quotation'),
('sent', 'Quotation Sent'),
('waiting', 'Waiting Approval'),
('sale', 'Sales Order'),
('done', 'Locked'),
('cancel', 'Cancelled'),
], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft')
def action_confirm(self):
discnt = 0.0
no_line = 0.0
if self.company_id.so_double_validation == 'two_step':
for line in self.order_line:
no_line += 1
discnt += line.discount
discnt = (discnt / no_line)
if self.company_id.so_double_validation_limit and discnt > self.company_id.so_double_validation_limit:
self.state = 'waiting'
return True
super(sale_discount, self).action_confirm()
def action_approve(self):
super(sale_discount, self).action_confirm()
return True
class Company(models.Model):
_inherit = 'res.company'
so_double_validation = fields.Selection([
('one_step', 'Confirm sale orders in one step'),
('two_step', 'Get 2 levels of approvals to confirm a sale order')
], string="Levels of Approvals", default='one_step',
help="Provide a double validation mechanism for sales discount")
so_double_validation_limit = fields.Float(string="Percentage of Discount that requires double validation'",
help="Minimum discount percentage for which a double validation is required")
class ResDiscountSettings(models.TransientModel):
_inherit = 'res.config.settings'
so_order_approval = fields.Boolean("Sale Discount Approval", default=lambda self: self.env.user.company_id.so_double_validation == 'two_step')
so_double_validation = fields.Selection(related='company_id.so_double_validation',string="Levels of Approvals *", readonly=False)
so_double_validation_limit = fields.Float(string="Discount limit requires approval in %",
related='company_id.so_double_validation_limit', readonly=False)
def set_values(self):
super(ResDiscountSettings, self).set_values()
self.so_double_validation = 'two_step' if self.so_order_approval else 'one_step'

98
sale_discount_total/models/sale.py

@ -0,0 +1,98 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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 odoo import api, fields, models
import odoo.addons.decimal_precision as dp
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.depends('order_line.price_total')
def _amount_all(self):
"""
Compute the total amounts of the SO.
"""
for order in self:
amount_untaxed = amount_tax = amount_discount = 0.0
for line in order.order_line:
amount_untaxed += line.price_subtotal
amount_tax += line.price_tax
amount_discount += (line.product_uom_qty * line.price_unit * line.discount) / 100
order.update({
'amount_untaxed': amount_untaxed,
'amount_tax': amount_tax,
'amount_discount': amount_discount,
'amount_total': amount_untaxed + amount_tax,
})
discount_type = fields.Selection([('percent', 'Percentage'), ('amount', 'Amount')], string='Discount type',
readonly=True,
states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
default='percent')
discount_rate = fields.Float('Discount Rate', digits=dp.get_precision('Account'),
readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]})
amount_untaxed = fields.Monetary(string='Untaxed Amount', store=True, readonly=True, compute='_amount_all',
track_visibility='always')
amount_tax = fields.Monetary(string='Taxes', store=True, readonly=True, compute='_amount_all',
track_visibility='always')
amount_total = fields.Monetary(string='Total', store=True, readonly=True, compute='_amount_all',
track_visibility='always')
amount_discount = fields.Monetary(string='Discount', store=True, readonly=True, compute='_amount_all',
digits=dp.get_precision('Account'), track_visibility='always')
@api.onchange('discount_type', 'discount_rate', 'order_line')
def supply_rate(self):
for order in self:
if order.discount_type == 'percent':
for line in order.order_line:
line.discount = order.discount_rate
else:
total = discount = 0.0
for line in order.order_line:
total += round((line.product_uom_qty * line.price_unit))
if order.discount_rate != 0:
discount = (order.discount_rate / total) * 100
else:
discount = order.discount_rate
for line in order.order_line:
line.discount = discount
def _prepare_invoice(self, ):
invoice_vals = super(SaleOrder, self)._prepare_invoice()
invoice_vals.update({
'discount_type': self.discount_type,
'discount_rate': self.discount_rate,
})
return invoice_vals
def button_dummy(self):
self.supply_rate()
return True
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
discount = fields.Float(string='Discount (%)', digits=(16, 20), default=0.0)

23
sale_discount_total/reports/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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 invoice_report
from . import sale_report

35
sale_discount_total/reports/invoice_report.py

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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 odoo import fields, models
class AccountInvoiceReport(models.Model):
_inherit = 'account.invoice.report'
discount = fields.Float('Discount', readonly=True)
def _select(self):
res = super(AccountInvoiceReport,self)._select()
select_str = res + """, line.discount AS discount """
return select_str

36
sale_discount_total/reports/sale_report.py

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Faslu Rahman(odoo@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 odoo import fields, models
class DiscountSaleReport(models.Model):
_inherit = 'sale.report'
discount = fields.Float('Discount', readonly=True)
def _select(self):
res = super(DiscountSaleReport,self)._select()
select_str = res+""",sum(l.product_uom_qty / u.factor * u2.factor * cr.rate * l.price_unit * l.discount / 100.0)
as discount"""
return select_str

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
sale_discount_total/static/description/assets/modules/approval_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
sale_discount_total/static/description/assets/modules/budget_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
sale_discount_total/static/description/assets/modules/magento_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
sale_discount_total/static/description/assets/modules/pos_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
sale_discount_total/static/description/assets/modules/shopify_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
sale_discount_total/static/description/assets/screenshots/screenshot-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
sale_discount_total/static/description/assets/screenshots/screenshot-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
sale_discount_total/static/description/assets/screenshots/screenshot-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
sale_discount_total/static/description/assets/screenshots/screenshot-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
sale_discount_total/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
sale_discount_total/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
sale_discount_total/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
sale_discount_total/static/description/images/approval.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
sale_discount_total/static/description/images/banner_lifeline_for_task.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
sale_discount_total/static/description/images/banner_project_report_xls_pdf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

BIN
sale_discount_total/static/description/images/banner_project_status_report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
sale_discount_total/static/description/images/banner_subtask.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
sale_discount_total/static/description/images/banner_task_deadline_reminder.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
sale_discount_total/static/description/images/banner_task_statusbar.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
sale_discount_total/static/description/images/checked.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
sale_discount_total/static/description/images/customer invoice.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
sale_discount_total/static/description/images/customer _invoice-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
sale_discount_total/static/description/images/cybrosys.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
sale_discount_total/static/description/images/sale order.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
sale_discount_total/static/description/images/settings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

602
sale_discount_total/static/description/index.html

@ -0,0 +1,602 @@
<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;">
Global Discount In Sale</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;">
Global Discount In Sale
</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="#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 class="col-md-6">
<a href="#video" 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;">
Video</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
Watch tutorial video on 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 allows you to mention discount on Total of sale order and
Total of Customer Invoice as percentage or as amount.
</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 15.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;">
Global Discount In Sale</h4>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Select 'Percentage' from Discount type and give discount percentage as Discount rate.</p>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Select 'Amount' from Discount type and give discount amount as Discount rate.</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;">
Sale Order</h4>
<img src="assets/screenshots/screenshot-1.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;">
Customer Invoice</h4>
<img src="assets/screenshots/screenshot-2.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;">
And the module also allows you to set a limit for total discount in percentage. Exceeding this limit will require approval. </h4>
<img src="assets/screenshots/screenshot-3.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;">
Manager level users can approve sale orders in 'Waiting Approval' stage.</h4>
<img src="assets/screenshots/screenshot-4.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/14.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 class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/14.0/dashboard_pos/" 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/pos_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/14.0/product_approval_management/"
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/approval_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/14.0/base_account_budget/" 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/budget_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/14.0/shopify_odoo_connector/" 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/shopify_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/14.0/odoo11_magento2/" 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/magento_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>WhatsApp</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>

41
sale_discount_total/views/account_invoice_view.xml

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="discount_account_invoice_view_form" model="ir.ui.view">
<field name="name">discount.account.invoice</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='discount']" position="attributes">
<attribute name="digits">[16, 2]</attribute>
</xpath>
<xpath expr="//field[@name='tax_totals_json']" position="after">
<field name="amount_discount"/>
</xpath>
<xpath expr="//field[@name='narration']" position="before">
<div>
<label for="discount_type" string="Discount Type :"/>
<field name="discount_type" class="oe_inline"/>
</div>
<div>
<label for="discount_rate" string="Discount Rate :"/>
<field name="discount_rate" class="oe_inline"/>
</div>
</xpath>
</field>
</record>
<!-- <record id="discount_view_invoice_line_tree" model="ir.ui.view">-->
<!-- <field name="name">discount.account.invoice.line.tree</field>-->
<!-- <field name="model">account.move.line.tree.grouped.sales.purchase</field>-->
<!-- <field name="inherit_id" ref="account.view_move_line_tree_grouped_sales_purchases"/>-->
<!-- <field name="arch" type="xml">-->
<!-- <xpath expr="//field[@name='debit']" position="attributes">-->
<!-- <attribute name="digits">[16, 2]</attribute>-->
<!-- </xpath>-->
<!-- </field>-->
<!-- </record>-->
</data>
</odoo>

20
sale_discount_total/views/invoice_report.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_invoice_customized" inherit_id="account.report_invoice_document">
<xpath expr="//span[@t-field='line.discount']" position="replace">
<span t-esc="'%.2f'%(line.discount)"/>
</xpath>
<xpath expr="//tr[hasclass('is-subtotal')]" position="after">
<tr>
<td>Discount</td>
<td class="text-right">
<span t-field="o.amount_discount"/>
</td>
</tr>
</xpath>
</template>
</data>
</odoo>

33
sale_discount_total/views/res_config_view.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form_sale_discount" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.sale.discount</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="10"/>
<field name="inherit_id" ref="sale.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@data-key='sale_management']/div[hasclass('o_settings_container')][2]/div[hasclass('o_setting_box')][2]" position="after">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="so_order_approval"/>
</div>
<div class="o_setting_right_pane">
<label for="so_order_approval"/>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
<div class="text-muted">
Managers must approve discount
</div>
<div class="content-group" attrs="{'invisible': [('so_order_approval', '=', False)]}">
<div class="row mt16">
<label for="so_double_validation_limit" class="col-md-4 o_light_label"/>
<field name="so_double_validation_limit"/>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

21
sale_discount_total/views/sale_order_report.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_saleorder_customized" inherit_id="sale.report_saleorder_document">
<xpath expr="//span[@t-field='line.discount']" position="replace">
<span t-esc="'%.2f'%(line.discount)"/>
</xpath>
<xpath expr="//tr[hasclass('is-subtotal')]" position="after">
<tr>
<td>Total Discount</td>
<td class="text-right">
<span t-field="doc.amount_discount"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
</td>
</tr>
</xpath>
</template>
</data>
</odoo>

53
sale_discount_total/views/sale_view.xml

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="discount_sale_view_form" model="ir.ui.view">
<field name="name">discount.sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="before">
<button string="Approve" type="object" name="action_approve" states="waiting" class="oe_highlight"
groups="sales_team.group_sale_manager"/>
</xpath>
<xpath expr="//button[@name='action_cancel']" position="attributes">
<attribute name="states">draft,sent,sale,waiting</attribute>
</xpath>
<xpath expr="//group[@name='note_group']" position="replace">
<group name="note_group" col="6">
<group name="discount" colspan="2">
<field name="discount_type"/>
<field name="discount_rate"/>
</group>
<group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
<field name="amount_untaxed" widget='monetary' options="{'currency_field': 'currency_id'}"/>
<field name="amount_discount" widget='monetary'
options="{'currency_field': 'currency_id'}"/>
<field name="amount_tax" widget='monetary' options="{'currency_field': 'currency_id'}"/>
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="amount_total"/>
<button name="button_dummy"
states="draft,sent" string="(update)" type="object"
class="oe_edit_only oe_link"/>
</div>
<field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator"
widget='monetary' options="{'currency_field': 'currency_id'}"/>
</group>
<group colspan="4">
<field name="note" nolabel="1" placeholder="Terms and conditions..."/>
</group>
<div class="oe_clear"/>
</group>
</xpath>
<!-- Roundoff the discount field -->
<xpath expr="//field[@name='order_line']/tree/field[@name='discount']" position="attributes">
<attribute name="digits">[16, 2]</attribute>
</xpath>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save