Browse Source

Jul 4 : [ADD] Initial Commit 'purchase_down_payment'

pull/280/head
AjmalCybro 2 years ago
parent
commit
210f89b8c0
  1. 46
      purchase_down_payment/README.rst
  2. 21
      purchase_down_payment/__init__.py
  3. 44
      purchase_down_payment/__manifest__.py
  4. 7
      purchase_down_payment/doc/RELEASE_NOTES.md
  5. 22
      purchase_down_payment/models/__init__.py
  6. 179
      purchase_down_payment/models/purchase_order.py
  7. 54
      purchase_down_payment/models/purchase_order_line.py
  8. 32
      purchase_down_payment/models/res_config_settings.py
  9. 2
      purchase_down_payment/security/ir.model.access.csv
  10. BIN
      purchase_down_payment/static/description/assets/icons/check.png
  11. BIN
      purchase_down_payment/static/description/assets/icons/chevron.png
  12. BIN
      purchase_down_payment/static/description/assets/icons/cogs.png
  13. BIN
      purchase_down_payment/static/description/assets/icons/consultation.png
  14. BIN
      purchase_down_payment/static/description/assets/icons/ecom-black.png
  15. BIN
      purchase_down_payment/static/description/assets/icons/education-black.png
  16. BIN
      purchase_down_payment/static/description/assets/icons/hotel-black.png
  17. BIN
      purchase_down_payment/static/description/assets/icons/license.png
  18. BIN
      purchase_down_payment/static/description/assets/icons/lifebuoy.png
  19. BIN
      purchase_down_payment/static/description/assets/icons/logo.png
  20. BIN
      purchase_down_payment/static/description/assets/icons/manufacturing-black.png
  21. BIN
      purchase_down_payment/static/description/assets/icons/pos-black.png
  22. BIN
      purchase_down_payment/static/description/assets/icons/puzzle.png
  23. BIN
      purchase_down_payment/static/description/assets/icons/restaurant-black.png
  24. BIN
      purchase_down_payment/static/description/assets/icons/service-black.png
  25. BIN
      purchase_down_payment/static/description/assets/icons/trading-black.png
  26. BIN
      purchase_down_payment/static/description/assets/icons/training.png
  27. BIN
      purchase_down_payment/static/description/assets/icons/update.png
  28. BIN
      purchase_down_payment/static/description/assets/icons/user.png
  29. BIN
      purchase_down_payment/static/description/assets/icons/wrench.png
  30. BIN
      purchase_down_payment/static/description/assets/modules/barcode_image.png
  31. BIN
      purchase_down_payment/static/description/assets/modules/biometric_image.png
  32. BIN
      purchase_down_payment/static/description/assets/modules/export_image.png
  33. BIN
      purchase_down_payment/static/description/assets/modules/login_image.png
  34. BIN
      purchase_down_payment/static/description/assets/modules/payroll_image.png
  35. BIN
      purchase_down_payment/static/description/assets/modules/sale_image.png
  36. BIN
      purchase_down_payment/static/description/assets/screenshots/hero.gif
  37. BIN
      purchase_down_payment/static/description/assets/screenshots/purchase1.png
  38. BIN
      purchase_down_payment/static/description/assets/screenshots/purchase2.png
  39. BIN
      purchase_down_payment/static/description/assets/screenshots/purchase3.png
  40. BIN
      purchase_down_payment/static/description/assets/screenshots/purchase4.png
  41. BIN
      purchase_down_payment/static/description/assets/screenshots/purchase5.png
  42. BIN
      purchase_down_payment/static/description/assets/screenshots/purchase6.png
  43. BIN
      purchase_down_payment/static/description/assets/screenshots/purchase7.png
  44. BIN
      purchase_down_payment/static/description/assets/screenshots/purchase8.png
  45. BIN
      purchase_down_payment/static/description/banner.jpg
  46. BIN
      purchase_down_payment/static/description/icon.png
  47. 700
      purchase_down_payment/static/description/index.html
  48. 20
      purchase_down_payment/views/purchase_order_view.xml
  49. 29
      purchase_down_payment/views/res_config_settings_view.xml
  50. 20
      purchase_down_payment/wizards/__init__.py
  51. 221
      purchase_down_payment/wizards/purchase_order_advance_payment.py
  52. 70
      purchase_down_payment/wizards/purchase_order_advance_payment_view.xml

46
purchase_down_payment/README.rst

@ -0,0 +1,46 @@
.. 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
Purchase Down Payment
=======================
This module helps to register down payment against the purchase order.
Configuration
=============
No additional configuration
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
License
=======
GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3)
(http://www.gnu.org/licenses/agpl.html)
Credits
-------
Developer: V15 - Aswathi PN @cybrosys, Contact: odoo@cybrosys.com
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>`__

21
purchase_down_payment/__init__.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (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.
##############################################################################
from . import models
from . import wizards

44
purchase_down_payment/__manifest__.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (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.
##############################################################################
{
'name': 'Purchase Down Payment',
'version': '15.0.1.0.0',
'summary': """Down payment with purchase order""",
'description': """"This module provides easy feature to register down payment against the purchase order.
User will be able to register down payment in percentage and amount that would deduct
from vendor bill.""",
'category': 'Purchase',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'depends': ['base', 'purchase', 'sale'],
'data': [
'security/ir.model.access.csv',
'wizards/purchase_order_advance_payment_view.xml',
'views/purchase_order_view.xml',
'views/res_config_settings_view.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

7
purchase_down_payment/doc/RELEASE_NOTES.md

@ -0,0 +1,7 @@
## Module <purchase_down_payment>
#### 03.05.2023
#### Version 15.0.1.0.0
#### ADD
- Initial commit for Purchase Down Payment

22
purchase_down_payment/models/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (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.
##############################################################################
from . import purchase_order
from . import purchase_order_line
from . import res_config_settings

179
purchase_down_payment/models/purchase_order.py

@ -0,0 +1,179 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (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.
##############################################################################
from odoo import api, models, _
from odoo.tools import float_is_zero
from itertools import groupby
from odoo.exceptions import UserError
class PurchaseOrder(models.Model):
"""
This class is created for inherited model Purchase Order.
Methods:
_nothing_to_invoice_error(self):
Function for showing the user error while there is no products are received for the purchase order.
_deduct_payment(self):
This function is for deducting the down payment amount from next down payment invoice.
_prepare_down_payment_section_line(self):
Function for creating dict of values to create a new purchase down payment section.
_get_invoiceable_lines(self):
Function for returning the orders invoiceable lines.
"""
_inherit = 'purchase.order'
@api.model
def _nothing_to_invoice_error(self):
"""Function to showing user error while there is no products are received for the purchase order"""
return UserError(_(
"There is nothing to bill!\n\n"
"Reason(s) of this behavior could be:\n"
"- You should receive your products before billing them: Click on the \"truck\" icon "
"(top-right of your screen) and follow instructions.\n"
"- You should modify the control policy of your product: Open the product, go to the "
"\"Purchase\" tab and modify control policy from \"On received quantities\" to \"On ordered "
"quantities\"."
))
def _deduct_payment(self, grouped=False, final=False, date=None):
"""
Create the Bill associated to the PO.
:returns: list of created invoices
"""
invoice_vals_list = []
invoice_item_sequence = 0 # Incremental sequencing to keep the lines order on the invoice.
for order in self:
order = order.with_company(order.company_id)
invoice_vals = order._prepare_invoice()
invoiceable_lines = order._get_invoiceable_lines(final)
if not any(not line.display_type for line in invoiceable_lines):
continue
invoice_line_vals = []
down_payment_section_added = False
for line in invoiceable_lines:
if not down_payment_section_added and line.is_downpayment:
invoice_line_vals.append(
(0, 0, order._prepare_down_payment_section_line(
sequence=invoice_item_sequence,
)),
)
down_payment_section_added = True
invoice_item_sequence += 1
invoice_line_vals.append(
(0, 0, line._prepare_invoice_line(
sequence=invoice_item_sequence,
)),
)
invoice_item_sequence += 1
invoice_vals['invoice_line_ids'] += invoice_line_vals
invoice_vals_list.append(invoice_vals)
if not invoice_vals_list:
raise self._nothing_to_invoice_error()
if not grouped:
new_invoice_vals_list = []
invoice_grouping_keys = self._get_invoice_grouping_keys()
invoice_vals_list = sorted(
invoice_vals_list,
key=lambda x: [
x.get(grouping_key) for grouping_key in invoice_grouping_keys
]
)
for grouping_keys, invoices in groupby(invoice_vals_list, key=lambda x: [x.get(grouping_key) for grouping_key in invoice_grouping_keys]):
origins = set()
payment_refs = set()
refs = set()
ref_invoice_vals = None
for invoice_vals in invoices:
if not ref_invoice_vals:
ref_invoice_vals = invoice_vals
else:
ref_invoice_vals['invoice_line_ids'] += invoice_vals['invoice_line_ids']
origins.add(invoice_vals['invoice_origin'])
payment_refs.add(invoice_vals['payment_reference'])
refs.add(invoice_vals['ref'])
ref_invoice_vals.update({
'ref': ', '.join(refs)[:2000],
'invoice_origin': ', '.join(origins),
'payment_reference': len(payment_refs) == 1 and payment_refs.pop() or False,
})
new_invoice_vals_list.append(ref_invoice_vals)
invoice_vals_list = new_invoice_vals_list
if len(invoice_vals_list) < len(self):
PurchaseOrderLine = self.env['purchase.order.line']
for invoice in invoice_vals_list:
sequence = 1
for line in invoice['invoice_line_ids']:
line[2]['sequence'] = PurchaseOrderLine._get_invoice_line_sequence(new=sequence, old=line[2]['sequence'])
sequence += 1
moves = self.env['account.move'].sudo().with_context(default_move_type='out_invoice').create(invoice_vals_list)
return moves
@api.model
def _prepare_down_payment_section_line(self, **optional_values):
"""
Prepare the dict of values to create a new down payment section for a purchase order line.
:param optional_values: any parameter that should be added to the returned down payment section
"""
context = {'lang': self.partner_id.lang}
down_payments_section_line = {
'display_type': 'line_section',
'name': _('Down Payments'),
'product_id': False,
'product_uom_id': False,
'quantity': 0,
'discount': 0,
'price_unit': 0,
'account_id': False
}
del context
if optional_values:
down_payments_section_line.update(optional_values)
return down_payments_section_line
def _get_invoice_grouping_keys(self):
"""Function to return the invoice grouping keys"""
return ['company_id', 'partner_id', 'currency_id']
def _get_invoiceable_lines(self, final=False):
"""Return the invoiceable lines for order `self`."""
down_payment_line_ids = []
invoiceable_line_ids = []
pending_section = None
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
for line in self.order_line:
if line.display_type == 'line_section':
pending_section = line
continue
if line.display_type != 'line_note' and float_is_zero(line.qty_to_invoice, precision_digits=precision):
continue
if line.qty_to_invoice > 0 or (line.qty_to_invoice < 0 and final) or line.display_type == 'line_note':
if line.is_downpayment:
down_payment_line_ids.append(line.id)
continue
if pending_section:
invoiceable_line_ids.append(pending_section.id)
pending_section = None
invoiceable_line_ids.append(line.id)
return self.env['purchase.order.line'].browse(invoiceable_line_ids + down_payment_line_ids)

54
purchase_down_payment/models/purchase_order_line.py

@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (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.
##############################################################################
from odoo import fields, models
class PurchaseOrderLine(models.Model):
"""
The class is created for inherited the model purchase.order.line.
"""
_inherit = 'purchase.order.line'
is_downpayment = fields.Boolean(
string="Is a down payment", help="Down payments are made when creating Bills from a purchase order."
" They are not copied when duplicating a purchase order.")
def _prepare_invoice_line(self, **optional_values):
"""
Prepare the dict of values to create the new bill line for a purchase order line.
:param qty: float quantity to bill
:param optional_values: any parameter that should be added to the returned bill line
"""
self.ensure_one()
res = {
'display_type': self.display_type,
'sequence': self.sequence,
'name': self.name,
'product_id': self.product_id.id,
'product_uom_id': self.product_uom.id,
'quantity': self.qty_to_invoice,
'price_unit': self.price_unit,
'purchase_line_id': self.id,
}
if optional_values:
res.update(optional_values)
if self.display_type:
res['account_id'] = False
return res

32
purchase_down_payment/models/res_config_settings.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (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.
##############################################################################
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
"""The class is to created for inherited the model Res Config Settings"""
_inherit = 'res.config.settings'
po_deposit_default_product_id = fields.Many2one(
'product.product',
'PO Deposit Product',
domain="[('type', '=', 'service')]",
config_parameter='purchase_down_payment.po_deposit_default_product_id',
help='Default product used for payment advances in purchase order')

2
purchase_down_payment/security/ir.model.access.csv

@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_purchase_order_advance_payment,access.purchase.order.advance.payment,model_purchase_order_advance_payment,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_purchase_order_advance_payment access.purchase.order.advance.payment model_purchase_order_advance_payment base.group_user 1 1 1 1

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/purchase1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/purchase2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/purchase3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/purchase4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/purchase5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/purchase6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/purchase7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
purchase_down_payment/static/description/assets/screenshots/purchase8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

BIN
purchase_down_payment/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
purchase_down_payment/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

700
purchase_down_payment/static/description/index.html

@ -0,0 +1,700 @@
<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;">
Purchase Down Payment</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;">
Down Payment with Purchase Order
</p>
<img src="./assets/screenshots/hero.gif" class="img-responsive"
width="100%" height="auto"/>
</div>
</div>
<div class="row">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin-bottom: 2rem !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-compass mr-2"></i>Explore this module
</h2>
</div>
<div class="col-md-6">
<a href="#overview" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Overview</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
Learn more about this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right"
style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#configuration" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Configuration</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
View configurations for this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right"
style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#features" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Features</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
View features of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right"
style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#screenshots" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Screenshots</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
See key screenshots of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right"
style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
</div>
<div class="row" id="overview">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-pie-chart mr-2"></i>Overview
</h2>
</div>
<div class="col-mg-12 pl-3">
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
This module provides easy feature to register down payment
against the purchase order. User will be able to register
down payment in percentage and amount that would deduct from
vendor bill.
</p>
</div>
</div>
<div class="row" id="configuration">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-pie-chart mr-2"></i>Configuration
</h2>
</div>
<div class="col-mg-12 pl-3">
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
No additional configuration required</p>
</div>
</div>
<div class="row" id="features">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-star mr-2"></i>Features
</h2>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Community &amp; Enterprise Support</h4>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Available in Odoo 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;">
Manage Vendor Bill Down Payment.</h4>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
We can easily manage the down payment with purchase
order.</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;">
Manage the deduction of down payments from invoices.</h4>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
You can choose whether to deduct the down payment from the invoice or not.</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;">
Different ways to create down payments.</h4>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
A bill can be created in three ways: with percentages, with fixed amounts, or with regular amounts.</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;">
Options For Creating Vendor Bill</h4>
<img src="assets/screenshots/purchase2.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;">
Down Payment with fixed amount.</h4>
<img src="assets/screenshots/purchase5.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;">
Down Payment with a Percentage</h4>
<img src="assets/screenshots/purchase6.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;">
Regular Bill</h4>
<img src="assets/screenshots/purchase7.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
</div>
<!-- SUGGESTED PRODUCTS -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="color: #212529 !important;">Suggested Products</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active" style="min-height:0px">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/hr_payroll_community/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/payroll_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/product_barcode/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/barcode_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/export_stockinfo_xls/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/export_image.png">
</div>
</a>
</div>
</div>
<div class="carousel-item" style="min-height:0px">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/sale_discount_total/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/sale_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/login_user_detail/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/login_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/hr_zk_attendance/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/biometric_image.png">
</div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev"
style="left:-25px;width: 35px;color: #000;"> <span
class="carousel-control-prev-icon"><i
class="fa fa-chevron-left"
style="font-size:24px"></i></span> </a> <a
class="carousel-control-next" href="#demo1"
data-slide="next"
style="right:-25px;width: 35px;color: #000;">
<span class="carousel-control-next-icon"><i
class="fa fa-chevron-right"
style="font-size:24px"></i></span>
</a>
</div>
</div>
</div>
<!-- END OF SUGGESTED PRODUCTS -->
<!-- OUR SERVICES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Services</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/cogs.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Customization</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/wrench.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/lifebuoy.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Support</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/user.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Hire
Odoo
Developer</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/puzzle.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Integration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/update.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Migration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/consultation.png"
class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Consultancy</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/training.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/license.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Licensing Consultancy</h6>
</div>
</div>
</section>
<!-- END OF END OF OUR SERVICES -->
<!-- OUR INDUSTRIES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Industries</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/trading-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Trading
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easily procure
and
sell your products</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/pos-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
POS
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easy
configuration
and convivial experience</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/education-black.png"
class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Education
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
A platform for
educational management</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/manufacturing-black.png"
class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Plan, track and
schedule your operations</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/ecom-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
E-commerce &amp; Website
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Mobile
friendly,
awe-inspiring product pages</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/service-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Service Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Keep track of
services and invoice</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/restaurant-black.png"
class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Restaurant
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Run your bar or
restaurant methodically</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/hotel-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Hotel Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
An
all-inclusive
hotel management application</p>
</div>
</div>
</div>
</section>
<!-- END OF END OF OUR INDUSTRIES -->
<!-- FOOTER -->
<!-- Footer Section -->
<section class="container" style="margin: 5rem auto 2rem;">
<div class="row" style="max-width:1540px;">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Need Help?</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
</div>
</div>
<!-- Contact Cards -->
<div class="row d-flex justify-content-center align-items-center"
style="max-width:1540px; margin: 0 auto 2rem auto;">
<div class="col-lg-12"
style="padding: 0rem 3rem 2rem; border-radius: 10px; margin-right: 3rem; ">
<div class="row mt-4">
<div class="col-lg-6">
<a href="mailto:odoo@cybrosys.com" target="_blank"
class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #4d4d4d; color: #FFF; border-radius: 4px;"><i
class="fa fa-envelope mr-2"></i>odoo@cybrosys.com</a>
</div>
<div class="col-lg-6">
<a href="https://api.whatsapp.com/send?phone=918606827707"
target="_blank"
class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #25D366; color: #FFF; border-radius: 4px;"><i
class="fa fa-whatsapp mr-2"></i>+91 86068 27707</a>
</div>
</div>
</div>
</div>
<!-- End of Contact Cards -->
</section>
<!-- Footer -->
<section class="oe_container" style="padding: 2rem 3rem 1rem;">
<div class="row"
style="max-width:1540px; margin: 0 auto; margin-right: 3rem; ">
<!-- Logo -->
<div class="col-lg-12 d-flex justify-content-center align-items-center"
style="margin-top: 3rem;">
<img src="https://www.cybrosys.com/images/logo.png"
width="200px" height="auto"/>
</div>
<!-- End of Logo -->
<div class="col-lg-12">
<hr
style="margin-top: 3rem;background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;">
<!-- End of Footer Section -->
</div>
</div>
</section>
<!-- END OF FOOTER -->
</div>

20
purchase_down_payment/views/purchase_order_view.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Inherited the Purchase Order form view to add a new button -->
<record id="purchase_order_view_form" model="ir.ui.view">
<field name="name">purchase.order.view.form.inherit.purchase.down.payment</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//header/button[@name='action_create_invoice']"
position="replace">
<button name="%(purchase_down_payment.action_purchase_bill_advance)d"
string="Create Bill"
attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}"
type="action" data-hotkey="w"/>
</xpath>
</field>
</record>
</odoo>

29
purchase_down_payment/views/res_config_settings_view.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<!-- Inherited the Res Config Settings to add new field on it-->
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.purchase.down.payment</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="95"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='matrix_setting_container']"
position="inside">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<span class="o_form_label">Down Payment</span>
<div class="text-muted">
Product used for down payments in purchase bill
</div>
<div class="text-muted">
<field name="po_deposit_default_product_id"/>
</div>
</div>
</div>
</xpath>
</field>
</record>
</data>
</odoo>

20
purchase_down_payment/wizards/__init__.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (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.
##############################################################################
from . import purchase_order_advance_payment

221
purchase_down_payment/wizards/purchase_order_advance_payment.py

@ -0,0 +1,221 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Aswathi PN (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.
##############################################################################
from datetime import datetime
from odoo import api, fields, models, _
from odoo.exceptions import UserError
import time
class PurchaseOrderAdvancePayment(models.TransientModel):
"""The class is created for creating a new model purchase order advance payment. """
_name = 'purchase.order.advance.payment'
_description = 'Purchase Order Advance Payment Bill'
@api.model
def _default_product_id(self):
"""Function to fetch the purchase down payment default product"""
product_id = self.env['ir.config_parameter'].sudo().get_param(
'purchase_down_payment.po_deposit_default_product_id')
return self.env['product.product'].browse(int(product_id)).exists()
@api.model
def _default_currency_id(self):
"""Function to fetch the currency_id from purchase order"""
if self._context.get(
'active_model') == 'purchase.order' and self._context.get(
'active_id', False):
purchase_order = self.env['purchase.order'].browse(
self._context.get('active_id'))
return purchase_order.currency_id
@api.model
def _default_has_down_payment(self):
"""Function to check the Purchase order has down payment or not"""
if self._context.get(
'active_model') == 'purchase.order' and self._context.get(
'active_id', False):
purchase_order = self.env['purchase.order'].browse(
self._context.get('active_id'))
return purchase_order.order_line.filtered(
lambda purchase_order_line: purchase_order_line.is_downpayment
)
return False
advance_payment_method = fields.Selection([
('delivered', 'Regular bill'),
('percentage', 'Down payment (percentage)'),
('fixed', 'Down payment (fixed amount)')
], string='Create Bill', default='delivered', required=True,
help="A standard bill is issued with all the order lines ready for billing, \
according to their billing policy (based on ordered or delivered quantity).")
has_down_payments = fields.Boolean('Has down payments',
default=_default_has_down_payment,
readonly=True, help='To check the invoice created for down payments or not')
product_id = fields.Many2one('product.product',
string='Down Payment Product',
domain=[('type', '=', 'service')],
default=_default_product_id, help='To add the down payment product')
deduct_down_payments = fields.Boolean('Deduct down payments', default=False,
help='To check the amount is deducted frm newly created invoice')
amount = fields.Float('Down Payment Amount', digits='Account',
help="The percentage of amount to be bill in advance, taxes excluded.")
currency_id = fields.Many2one('res.currency', string='Currency',
default=_default_currency_id, help='Company Currency')
fixed_amount = fields.Monetary('Down Payment Amount (Fixed)',
help="The fixed amount to be bill in advance, taxes excluded.")
def _get_advance_details(self, order):
"""Function to find get the down payment amount and purchase order"""
context = {'lang': order.partner_id.lang}
if self.advance_payment_method == 'percentage':
if all(self.product_id.taxes_id.mapped('price_include')):
amount = order.amount_total * self.amount / 100
else:
amount = order.amount_untaxed * self.amount / 100
name = _("Down payment of %s%%") % (self.amount)
else:
amount = self.fixed_amount
name = _('Down Payment')
del context
return amount, name
def _prepare_po_line(self, order, analytic_tag_ids, tax_ids, amount):
"""Function to getting the purchase order line data"""
context = {'lang': order.partner_id.lang}
po_values = {
'name': _('Down Payment: %s') % (time.strftime('%m %Y'),),
'price_unit': amount,
'product_uom_qty': 0.0,
'product_qty': 0.0,
'order_id': order.id,
'product_uom': self.product_id.uom_id.id,
'product_id': self.product_id.id,
'analytic_tag_ids': analytic_tag_ids,
'taxes_id': [(6, 0, tax_ids)],
'is_downpayment': True,
'sequence': order.order_line and order.order_line[
-1].sequence + 1 or 10,
'date_planned': datetime.today(),
}
del context
return po_values
def _prepare_invoice_values(self, order, name, amount, so_line):
"""Function for take invoice values"""
invoice_vals = {
'ref': order.partner_ref or '',
'move_type': 'in_invoice',
'invoice_origin': order.name,
'invoice_user_id': order.user_id.id,
'narration': order.notes,
'partner_id': order.partner_id.id,
'fiscal_position_id': (
order.fiscal_position_id or order.fiscal_position_id.get_fiscal_position(
order.partner_id.id)).id,
'currency_id': order.currency_id.id,
'payment_reference': order.partner_ref or '',
'invoice_payment_term_id': order.payment_term_id.id,
'partner_bank_id': order.company_id.partner_id.bank_ids[:1].id,
'invoice_line_ids': [(0, 0, {
'name': name,
'price_unit': amount,
'quantity': 1.0,
'product_id': self.product_id.id,
'purchase_line_id': so_line.id,
'product_uom_id': so_line.product_uom.id,
})],
}
return invoice_vals
def _create_bill(self, order, so_line, amount):
"""Function for creating the purchase bill"""
if (self.advance_payment_method == 'percentage' and self.amount <= 0.00) or (
self.advance_payment_method == 'fixed' and self.fixed_amount <= 0.00):
raise UserError(
_('The value of the down payment amount must be positive.'))
amount, name = self._get_advance_details(order)
invoice_vals = self._prepare_invoice_values(order, name, amount,
so_line)
if order.fiscal_position_id:
invoice_vals['fiscal_position_id'] = order.fiscal_position_id.id
invoice = self.env['account.move'].with_company(order.company_id) \
.sudo().create(invoice_vals).with_user(self.env.uid)
invoice.message_post_with_view('mail.message_origin_link',
values={'self': invoice,
'origin': order},
subtype_id=self.env.ref(
'mail.mt_note').id)
return invoice
def create_advance_bill(self):
"""Function for creating purchase down payment bill"""
purchase_order = self.env['purchase.order'].browse(
self._context.get('active_ids', []))
if self.advance_payment_method == 'delivered':
if self.deduct_down_payments:
purchase_order._deduct_payment(final=self.deduct_down_payments)
else:
purchase_order.action_create_invoice()
else:
if not self.product_id:
vals = self.env['sale.advance.payment.inv']._prepare_deposit_product()
self.product_id = self.env['product.product'].create(vals)
self.env['ir.config_parameter'].sudo().set_param(
'purchase_down_payment.po_deposit_default_product_id',
self.product_id.id)
purchase_line_obj = self.env['purchase.order.line']
for order in purchase_order:
amount, name = self._get_advance_details(order)
if self.product_id.invoice_policy != 'order':
raise UserError(
_('The product used to invoice a down payment should have an invoice policy set to "Ordered quantities". Please update your deposit product to be able to create a deposit invoice.'))
if self.product_id.type != 'service':
raise UserError(
_("The product used to invoice a down payment should be of type 'Service'. Please use another product or update this product."))
taxes = self.product_id.taxes_id.filtered(
lambda
r: not order.company_id or r.company_id == order.company_id)
tax_ids = order.fiscal_position_id.map_tax(taxes).ids
analytic_tag_ids = []
for line in order.order_line:
analytic_tag_ids = [(4, analytic_tag.id, None) for
analytic_tag in line.analytic_tag_ids]
po_line_values = self._prepare_po_line(order, analytic_tag_ids,
tax_ids, amount)
po_line = purchase_line_obj.create(po_line_values)
self._create_bill(order, po_line, amount)
if self._context.get('open_invoices', False):
return purchase_order.action_view_invoice()
return {'type': 'ir.actions.act_window_close'}
if self._context.get('open_invoices', False):
return purchase_order.action_view_invoice()
return {'type': 'ir.actions.act_window_close'}

70
purchase_down_payment/wizards/purchase_order_advance_payment_view.xml

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Purchase Order Advance Payment Wizard-->
<record id="purchase_order_advance_payment_view_form" model="ir.ui.view">
<field name="name">purchase.order.advance.payment.view.form</field>
<field name="model">purchase.order.advance.payment</field>
<field name="arch" type="xml">
<form string="Purchase Order Advance Bill">
<p class="oe_grey">
Bills will be created in draft so that you can review them
before validation.
</p>
<group>
<field name="advance_payment_method" class="oe_inline"
widget="radio"/>
<field name="has_down_payments" invisible="1"/>
<label for="deduct_down_payments" string=""
attrs="{'invisible': ['|', ('has_down_payments', '=', False), ('advance_payment_method', '!=', 'delivered')]}"/>
<div attrs="{'invisible': ['|', ('has_down_payments', '=', False), ('advance_payment_method', '!=', 'delivered')]}"
id="down_payment_details">
<field name="deduct_down_payments" nolabel="1"/>
<label for="deduct_down_payments"/>
</div>
<label for="amount"
attrs="{'invisible': [('advance_payment_method', 'not in', ('fixed','percentage'))]}"/>
<div attrs="{'invisible': [('advance_payment_method', 'not in', ('fixed','percentage'))]}"
id="payment_method_details">
<field name="currency_id" invisible="1"/>
<field name="fixed_amount"
attrs="{'required': [('advance_payment_method', '=', 'fixed')], 'invisible': [('advance_payment_method', '!=','fixed')]}"
class="oe_inline"/>
<field name="amount"
attrs="{'required': [('advance_payment_method', '=', 'percentage')], 'invisible': [('advance_payment_method', '!=', 'percentage')]}"
class="oe_inline"/>
<span
attrs="{'invisible': [('advance_payment_method', '!=', 'percentage')]}"
class="oe_inline">%
</span>
</div>
<field name="product_id"
context="{'default_invoice_policy': 'order'}"
class="oe_inline"
attrs="{'invisible': [('advance_payment_method', 'not in', ('fixed','percentage'))]}"/>
</group>
<footer>
<button name="create_advance_bill"
string="Create and View Bill" type="object"
context="{'open_invoices': True}"
class="btn-primary" data-hotkey="q"/>
<button name="create_advance_bill" id="create_advance_bill"
string="Create Bill" type="object"
data-hotkey="w"/>
<button string="Cancel" class="btn-secondary"
special="cancel" data-hotkey="z"/>
</footer>
</form>
</field>
</record>
<!--Purchase Order Advance Payment Wizard action-->
<record id="action_purchase_bill_advance" model="ir.actions.act_window">
<field name="name">Create Bill</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order.advance.payment</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
<field name="binding_view_types">list</field>
</record>
</odoo>
Loading…
Cancel
Save