Skip to content
Permalink
Browse files

[DELETE IT]

  • Loading branch information...
KolushovAlexandr authored and Ommo73 committed Apr 23, 2019
1 parent ba40e7f commit 3bfa1904b9fc8b601d5261c9c8bc6a636fc65e85
Showing with 9,281 additions and 0 deletions.
  1. +64 −0 pos_debt_notebook/README.rst
  2. +26 −0 pos_debt_notebook/__init__.py
  3. +62 −0 pos_debt_notebook/__manifest__.py
  4. +24 −0 pos_debt_notebook/data.xml
  5. +23 −0 pos_debt_notebook/data/demo.xml
  6. +20 −0 pos_debt_notebook/data/product.xml
  7. +142 −0 pos_debt_notebook/doc/changelog.rst
  8. +148 −0 pos_debt_notebook/doc/index.rst
  9. +832 −0 pos_debt_notebook/i18n/de.po
  10. +842 −0 pos_debt_notebook/i18n/es.po
  11. +834 −0 pos_debt_notebook/i18n/fr.po
  12. +134 −0 pos_debt_notebook/i18n/pos_debt_notebook.pot
  13. +824 −0 pos_debt_notebook/i18n/ru.po
  14. BIN pos_debt_notebook/images/debt_notebook.png
  15. +11 −0 pos_debt_notebook/migrations/10.0.5.0.0/post-migrate.py
  16. +18 −0 pos_debt_notebook/migrations/10.0.5.0.0/pre-migrate.py
  17. +655 −0 pos_debt_notebook/models.py
  18. +3 −0 pos_debt_notebook/report/__init__.py
  19. +219 −0 pos_debt_notebook/report/pos_debt_report.py
  20. +5 −0 pos_debt_notebook/security/ir.model.access.csv
  21. +17 −0 pos_debt_notebook/security/pos_debt_notebook_security.xml
  22. BIN pos_debt_notebook/static/description/credit_report-1.png
  23. BIN pos_debt_notebook/static/description/credit_report-2.png
  24. BIN pos_debt_notebook/static/description/credit_report.png
  25. BIN pos_debt_notebook/static/description/debt_history-1.png
  26. BIN pos_debt_notebook/static/description/debt_history.png
  27. BIN pos_debt_notebook/static/description/ecommerce_credit_product.png
  28. BIN pos_debt_notebook/static/description/icon.png
  29. +613 −0 pos_debt_notebook/static/description/index.html
  30. BIN pos_debt_notebook/static/description/pos_credit_journal.png
  31. BIN pos_debt_notebook/static/description/pos_credit_product.png
  32. BIN pos_debt_notebook/static/description/pos_credit_product1.png
  33. BIN pos_debt_notebook/static/description/pos_credit_product2.png
  34. BIN pos_debt_notebook/static/description/pos_credit_product3.png
  35. BIN pos_debt_notebook/static/description/pos_debt_1.png
  36. BIN pos_debt_notebook/static/description/pos_debt_2.png
  37. BIN pos_debt_notebook/static/description/pos_debt_3.png
  38. BIN pos_debt_notebook/static/description/pos_debt_autopay.png
  39. BIN pos_debt_notebook/static/description/pos_debt_autopay1.png
  40. BIN pos_debt_notebook/static/description/pos_debt_autopay2.png
  41. BIN pos_debt_notebook/static/description/pos_debt_history.png
  42. BIN pos_debt_notebook/static/description/pos_debt_history_button.png
  43. BIN pos_debt_notebook/static/description/pos_debt_options.png
  44. BIN pos_debt_notebook/static/description/pos_debt_res_1.png
  45. BIN pos_debt_notebook/static/description/pos_debt_res_2.png
  46. BIN pos_debt_notebook/static/description/pos_debt_thumbs_up.png
  47. BIN pos_debt_notebook/static/description/pos_debt_type.png
  48. BIN pos_debt_notebook/static/description/pos_display_credit.png
  49. BIN pos_debt_notebook/static/description/pos_display_debt.png
  50. BIN pos_debt_notebook/static/description/pos_handling_employees.png
  51. BIN pos_debt_notebook/static/description/pos_invoices_generated.png
  52. BIN pos_debt_notebook/static/description/pos_manual_credit_updates.png
  53. BIN pos_debt_notebook/static/description/pos_manual_credit_updates_list.png
  54. BIN pos_debt_notebook/static/description/pos_pay_full_debt1.png
  55. BIN pos_debt_notebook/static/description/pos_pay_full_debt2.png
  56. BIN pos_debt_notebook/static/description/pos_pay_full_debt3.png
  57. BIN pos_debt_notebook/static/description/screenshot-1.png
  58. BIN pos_debt_notebook/static/description/screenshot-2.png
  59. BIN pos_debt_notebook/static/description/screenshot-3.png
  60. BIN pos_debt_notebook/static/description/screenshot-4.png
  61. BIN pos_debt_notebook/static/description/screenshot-5.png
  62. BIN pos_debt_notebook/static/description/screenshot-6.png
  63. BIN pos_debt_notebook/static/description/screenshot-7.png
  64. BIN pos_debt_notebook/static/description/screenshot-8.png
  65. +1,287 −0 pos_debt_notebook/static/src/css/pos.css
  66. +1,195 −0 pos_debt_notebook/static/src/js/pos.js
  67. +85 −0 pos_debt_notebook/static/src/js/test_pos_debt.js
  68. +327 −0 pos_debt_notebook/static/src/xml/pos.xml
  69. +4 −0 pos_debt_notebook/tests/__init__.py
  70. +75 −0 pos_debt_notebook/tests/test_newbalance.py
  71. +26 −0 pos_debt_notebook/tests/test_pos_debt.py
  72. +162 −0 pos_debt_notebook/views.xml
  73. +107 −0 pos_debt_notebook/views/pos_credit_update.xml
  74. +127 −0 pos_debt_notebook/views/pos_debt_report_view.xml
  75. +4 −0 pos_debt_notebook/wizard/__init__.py
  76. +87 −0 pos_debt_notebook/wizard/pos_credit_company_invoices.py
  77. +49 −0 pos_debt_notebook/wizard/pos_credit_company_invoices_views.xml
  78. +160 −0 pos_debt_notebook/wizard/pos_credit_invoices.py
  79. +70 −0 pos_debt_notebook/wizard/pos_credit_invoices_views.xml
@@ -0,0 +1,64 @@
==============================
Debt/Credit notebook for POS
==============================

The module allows to make sale on credit.

Debt (Credit) value is changed whenever:

* Product marked as "Credit Product" is sold via POS or via Invoices. Invoices created via website_sale (eCommerce) module are supported too.
* POS payment is made via journal marked as "Debt journal"
* "Manual Credit Updates" is added

Other features:

* each user has Debt Limit field. By default is 0, i.e. user has to pay in advance and cannot have negative credits amount.
* Working with employees of company. You can get a sum of Credits of all employess of any company. You can make invoices per each employee at once to updates their Credits.

Installation \ Deinstallation
=============================

* Debt data are still available after the module will be re-installed.
* When new (first after install) POS session is opened, a debt payment method would added in a POS config.
* If the module was install and uninstall immediately (without created POS sessions) then it keeps no data.
* If a user deleted debt journal from POS config manually then after the module is upgraded
POS config would not be changed.
* Multicompany mode is supported

Roadmap
=======

* TODO. New option for **Zero transactions** feature: allow to create extra order line with negative amount instead of applying discounts.

* It creates extra record in accounting system (pos.order.line). It can be used as a backup for *Manual Updates*
* It works with following problem case:

In case of purchasing products with taxes not included in the price, such journals cannot be used along with normal payments


Credits
=======

Contributors
------------
* `Ivan Yelizariev <https://it-projects.info/team/yelizariev>`__
* `Stanislav Krotov <https://it-projects.info/team/ufaks>`__
* `Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>`__
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__

Sponsors
--------
* `IT-Projects LLC <https://it-projects.info>`__

Further information
===================

Demo: http://runbot.it-projects.info/demo/pos-addons/9.0

HTML Description: https://apps.odoo.com/apps/modules/9.0/pos_debt_notebook/

Usage instructions: `<doc/index.rst>`__

Changelog: `<doc/changelog.rst>`__

Tested on Odoo 10.0 8bd56bb46628e57f41c635f20c527264d7a20d86
@@ -0,0 +1,26 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from . import models
from . import report
from . import wizard

from openerp import SUPERUSER_ID
from openerp import api
from openerp.tools.translate import _
from odoo.exceptions import UserError


def pre_uninstall(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
if env['pos.session'].search([('state', '=', 'opened')]):
raise UserError(_('You have open session of Point of Sale. Please close them first.'))

debt_journals = env['account.journal'].search([('debt', '=', True)])
value = []
for journal in debt_journals:
value.append((3, journal.id))

for config in env['pos.config'].search([]):
config.write({
'journal_ids': value,
})
@@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-
# Copyright 2014-2019 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2015 Bassirou Ndaw <https://github.com/bassn>
# Copyright 2015 Alexis de Lattre <https://github.com/alexis-via>
# Copyright 2016-2017 Stanislav Krotov <https://it-projects.info/team/ufaks>
# Copyright 2017 Ilmir Karamov <https://it-projects.info/team/ilmir-k>
# Copyright 2017 Artyom Losev
# Copyright 2017 Lilia Salihova
# Copyright 2017-2018 Gabbasov Dinar <https://it-projects.info/team/GabbasovDinar>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
'name': 'POS Debt & Credit notebook',
'summary': 'Comfortable sales for your regular customers. Debt payment method for POS',
'category': 'Point Of Sale',
'live_test_url': 'http://apps.it-projects.info/shop/product/pos-debt-notebook?version=10.0',
"images": ['images/debt_notebook.png'],
'version': '10.0.5.3.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
"support": "pos@it-projects.info",
'website': 'https://it-projects.info',
'license': 'LGPL-3',
"price": 280.00,
"currency": "EUR",

"external_dependencies": {"python": [], "bin": []},
'depends': [
'point_of_sale',
'base_groupby_extra',
],
'data': [
'security/pos_debt_notebook_security.xml',
'data/product.xml',
'views/pos_debt_report_view.xml',
'views.xml',
'views/pos_credit_update.xml',
'wizard/pos_credit_invoices_views.xml',
'wizard/pos_credit_company_invoices_views.xml',
'data.xml',
'security/ir.model.access.csv',
],
'qweb': [
'static/src/xml/pos.xml',
],
"demo": [
'data/demo.xml',
],
'installable': True,
'uninstall_hook': 'pre_uninstall',

"demo_title": "POS Debt/Credit Notebook",
"demo_addons": [
],
"demo_addons_hidden": [
],
"demo_url": "pos-debt-notebook",
"demo_summary": "Comfortable sales for your regular customers.",
"demo_images": [
"images/debt_notebook.png",
]
}
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Copyright 2014-2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
Copyright 2015 Alexis de Lattre <https://github.com/alexis-via>
Copyright 2016 Stanislav Krotov <https://it-projects.info/team/ufaks>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). -->

<openerp>
<data>

<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_debt_notebook/static/src/js/pos.js"></script>
<link rel="stylesheet" href="/pos_debt_notebook/static/src/css/pos.css" id="pos_debt_notebook-stylesheet"/>
</xpath>
</template>

<template id="demo_assets_backend" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_debt_notebook/static/src/js/test_pos_debt.js"></script>
</xpath>
</template>

</data>
</openerp>
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<!--Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). -->

<openerp>
<data>

<!--Set field debt to 'credit' in model pos.config.settings via get_default_debt_type-->
<function model="ir.config_parameter" name="set_param" eval="('pos_debt_notebook.debt_type', 'credit', ['base.group_system'])" />

<record id="product_credit_product" model="product.product">
<field name="name">Credits top-up</field>
<field name="default_code">POS-DEBT</field>
<field name="sale_ok" eval="True"/>
<field name="available_in_pos" eval="True"/>
<field name="list_price">1</field>
<field name="type">service</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="description">This is a product for purchasing "Credits".</field>
</record>

</data>
</openerp>
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<!--Copyright 2016 Stanislav Krotov <https://it-projects.info/team/ufaks>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). -->

<openerp>
<data noupdate="1">

<record id="product_pay_debt" model="product.product">
<field name="name">Pay Debt</field>
<field name="default_code">POS-DEBT</field>
<field name="sale_ok" eval="True"/>
<field name="available_in_pos" eval="True"/>
<field name="list_price">0</field>
<field name="type">service</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="description">This is a dummy product used when a customer pays his debt without ordering new products. This is a workaround to the fact that Odoo needs to have at least one product on the order to validate the transaction.</field>
</record>

</data>
</openerp>
@@ -0,0 +1,142 @@
`5.3.0`
-------
- **Improvement:** New Balance is amount for selected journal, not for total Credits.

`5.2.0`
-------
- **ADD:** Button on the ``Write-off Credits`` form. Adds all partners with debt according to the selected journal
- **ADD:** Availability to write-off credits via ``Manual Credit Updates``

`5.1.4`
-------
- **FIX:** Payment mistakes on in case SERIALIZATION_FAILURE in order processing

`5.1.3`
-------
- **FIX:** Error related to pos loading with the lack of customers

`5.1.2`
-------
- **FIX:** Availability to buy credit top-up products with discount credits
- **FIX:** Error related to automatic receipt printing
- **ADD:** Mandatory Payment Method selection for return orders
- **FIX:** Compatibility with pos_category_multi
- **FIX:** Unavailability to cash out credits from journals with defined category
- **FIX:** Errors on loading debts on POS opening were ignored

`5.1.1`
-------
- **FIX:** Compatibility with pos_orders_history_return module

`5.1.0`
-------
- **NEW:** Wizard allow to create invoices for sets of partners: `Balance update`, `New Balance`
- **FIX:** Error related to paying with not discount credit journals in POS
- **FIX:** Invoices paid with credit journals now counts in partner debts

`5.0.3`
-------
- **FIX:** Error related to invoices created in the "Generate POS Credit Invoices" wizard. Invoices were created with wrong type.

`5.0.2`
-------

- **FIX:** Error related to debt loading after creating a new partner in POS

`5.0.1`
-------

- **Fix:** installation error in some cases

`5.0.0`
-------

- **ADD:** Cash out feature
- **ADD:** Multiple debit credit accounts
- **ADD:** Smart button with debts/credits on a customer view
- **ADD:** Credits via discount
- **FIX:** Debt history for Chinese localization
- **FIX:** Error when user doesn't have timezone
- **FIX:** user_id was always replaced to Administrator in pos.order
- **IMP:** Updating debts/credits data for partners in opened orders after restoring the internet connection
- **ADD:** Option 'Autopay' for debt journals

`4.4.3`
-------

- **FIX:** Compatibility with Chinese localization

`4.4.2`
-------

- **ADD:** Compatibility with Pos Mobile

`4.4.1`
-------

- **FIX:** Extra Debt payment lines when using "Pay Full Debt" method.
- **FIX:** Incorrect order validation.

`4.4.0`
-------

- **ADD:** new field *Company Credit Balance* -- sum of credits of all company's employees.
- **FIX:** move Debt fields at partner form. New place is Point of Sale section at Sales & Purchases tab. Otherwise the fields are hidden if partner has parent_id value
- **ADD:** wizard to add Credits to company's employees. It creates invoices per each partner.

`4.3.0`
-------

- **ADD:** Manual Credit Updates

`4.2.0`
-------

- **ADD:** The "Load More" button in debt history
- **ADD:** A product list to each debt history line

`4.1.0`
-------

- **ADD:** Invoice support
- **FIX:** Fetch new partners before loading their debt history (e.g. when another POS create partner)
- **ADD:** print prev and new debt value in receipt as well as customer name

`4.0.0`
-------

- **ADD:** An ability to show customer debt transactions
- **ADD:** Credits can be purchased via Credit Product. No need to use Debt Journal at that case
- **ADD:** Max Debt setting per each customer. Default is 0.
- **ADD:** Age analysis, debt statistics
- **ADD:** An ability to select a way to display debt values: debt or credit
- **ADD:** Colors of debt values

`3.0.1`
-------

- FIX: The "change" can be added to Debt Journal as negative amount of debt

`3.0.0`
-------

- Merge with the module "tg_pos_debt_notebook"

`2.0.0`
-------

- Add Multi-Company Mode

`1.0.2`
-------

- Add Dummy product settings to pay debt

`1.0.1`
-------

- Port to the new API of Odoo
- Add *debt* field in account.journal form view
- Add *debt* field in res.partner kanban view
- Add French translation
- Code is now PEP8 compliant

0 comments on commit 3bfa190

Please sign in to comment.
You can’t perform that action at this time.