Browse Source

[INIT][pos_no_bank_statement]

pull/24/head
Andrius Preimantas 10 years ago
parent
commit
7794bc641e
  1. 40
      pos_no_bank_statement/README.rst
  2. 5
      pos_no_bank_statement/__init__.py
  3. 25
      pos_no_bank_statement/__openerp__.py
  4. 6
      pos_no_bank_statement/model/__init__.py
  5. 16
      pos_no_bank_statement/model/account.py
  6. 21
      pos_no_bank_statement/model/point_of_sale.py
  7. 17
      pos_no_bank_statement/view/account.xml

40
pos_no_bank_statement/README.rst

@ -0,0 +1,40 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
POS No Bank Statement
=====================
This module allows user make POS Payment Method (Account Journal) not to create
Bank Statement Lines. This also means that no Journal Entries is going to be
created. One possible usage of the module is when products are sold only by
issuing an Invoice without registering any payment.
Usage
=====
* Create new Account Journal (e.g. "On Debt") marked as "PoS Payment Method" and
"No Bank Statement"
* When selling goods select this method and click "Invoice"
Credits
=======
Contributors
------------
* Andrius Preimantas <andrius@versada.lt>
Maintainer
----------
.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.

5
pos_no_bank_statement/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# This file is part of OpenERP. The COPYRIGHT file at the top level of
# this module contains the full copyright notices and license terms.
from . import model

25
pos_no_bank_statement/__openerp__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# This file is part of OpenERP. The COPYRIGHT file at the top level of
# this module contains the full copyright notices and license terms.
{
'name': 'POS No Bank Statement',
'version': '0.1',
'author': 'Versada UAB',
'category': 'Other',
'website': 'http://www.versada.lt',
'description': """
This module allows user make POS Payment Method (Account Journal) not to create
Bank Statement Lines. This also means that no Journal Entries is going to be
created. One possible usage of the module is when products are sold only by
issuing an Invoice without registering any payment.
""",
'depends': [
'point_of_sale'
],
'data': [
'view/account.xml',
],
'installable': True,
'application': False,
}

6
pos_no_bank_statement/model/__init__.py

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of OpenERP. The COPYRIGHT file at the top level of
# this module contains the full copyright notices and license terms.
from . import account
from . import point_of_sale

16
pos_no_bank_statement/model/account.py

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# This file is part of OpenERP. The COPYRIGHT file at the top level of
# this module contains the full copyright notices and license terms.
from openerp import models, fields
class AccountJournal(models.Model):
_inherit = "account.journal"
no_bank_statement = fields.Boolean(
string="No Bank Statemenet",
help="Select if you do not want bank statements created. It basicaly "
"makes this a dummy method because it will no longer make any impact on"
" your accounts. One use case might be when you want to sell products "
"only by issuing an Invoice without registering any payments.")

21
pos_no_bank_statement/model/point_of_sale.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# This file is part of OpenERP. The COPYRIGHT file at the top level of
# this module contains the full copyright notices and license terms.
from openerp import models, api
class POSOrder(models.Model):
_inherit = "pos.order"
@api.v7
def add_payment(self, cr, uid, order_id, data, context=None):
journal_id = data.get('journal')
if journal_id:
journal_rec = self.pool.get('account.journal').browse(
cr, uid, journal_id, context)
if journal_rec.no_bank_statement:
return None
return super(POSOrder, self).add_payment(
cr, uid, order_id, data, context)

17
pos_no_bank_statement/view/account.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- account.journal -->
<record model="ir.ui.view" id="view_account_journal_pos_user_form_inherit">
<field name="name">POS Journal Inherit</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="point_of_sale.view_account_journal_pos_user_form"/>
<field name="arch" type="xml">
<field name="journal_user" position="after">
<field name="no_bank_statement" attrs="{'readonly': [('journal_user', '=', False)]}"/>
</field>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save