Browse Source

[ADD] TASK S004 Cash opening Balance

pull/1/head
Thibault Francois 9 years ago
parent
commit
6db5a9894a
  1. 2
      beescoop_pos/__init__.py
  2. 31
      beescoop_pos/__openerp__.py
  3. 1
      beescoop_pos/models/__init__.py
  4. 26
      beescoop_pos/models/beescoop_pos.py
  5. 19
      beescoop_pos/views/beescoop_pos.xml

2
beescoop_pos/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
import models

31
beescoop_pos/__openerp__.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
{
'name': "Beescoop Point of sale",
'summary': """
Module that extends the pos for the beescoop
""",
'description': """
Long description of module's purpose
""",
'author': "Beescoop - Cellule IT",
'website': "https://github.com/beescoop/Obeesdoo",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml
# for the full list
'category': 'Point Of Sale',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['point_of_sale', 'beesdoo_base'],
# always loaded
'data': [
# 'security/ir.model.access.csv',
'views/beescoop_pos.xml',
],
# only loaded in demonstration mode
}

1
beescoop_pos/models/__init__.py

@ -0,0 +1 @@
import beescoop_pos

26
beescoop_pos/models/beescoop_pos.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
from openerp import models, fields
class BeesPOS(models.Model):
_inherit = 'pos.config'
bill_value = fields.One2many('bill_value', 'pos')
class BillValue(models.Model):
_name = 'bill_value'
_order = 'name asc'
name = fields.Float(string='Name')
pos = fields.Many2one('pos.config')
class BeesAccountBankStatement(models.Model):
_inherit = 'account.bank.statement.cashbox'
def _get_default_line(self):
if not self.env.context.get('active_id'):
return []
pos_session_rec = self.env['pos.session'].browse(self.env.context['active_id'])
return [(0, 0, {'coin_value' : bill_value_rec.name}) for bill_value_rec in pos_session_rec.config_id.bill_value]
cashbox_lines_ids = fields.One2many(default=_get_default_line)

19
beescoop_pos/views/beescoop_pos.xml

@ -0,0 +1,19 @@
<openerp>
<data>
<record model="ir.ui.view" id="beescoop_pos_inherit">
<field name="name">bees.pos.config.form.view</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.view_pos_config_form" />
<field name="arch" type="xml">
<field name="iface_tax_included" position="after">
<separator string="Bill Value" colspan="2" />
<field name="bill_value" nolabel="1" colspan="2" >
<tree editable="bottom">
<field name="name" />
</tree>
</field>
</field>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save