Browse Source

[ADD] SPEC0004: default coin opening value

pull/1/merge
Your Name 9 years ago
parent
commit
b1441bec33
  1. 2
      beescoop_pos/__init__.py
  2. 34
      beescoop_pos/__openerp__.py
  3. 33
      beescoop_pos/beescoop_pos.py
  4. 17
      beescoop_pos/beescoop_pos.xml

2
beescoop_pos/__init__.py

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

34
beescoop_pos/__openerp__.py

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
{
'name': "bees_member",
'summary': """
Module to manage bees members
""",
'description': """
Long description of module's purpose
""",
'author': "My Company",
'website': "http://www.yourcompany.com",
# 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': 'Uncategorized',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['point_of_sale'],
# always loaded
'data': [
# 'security/ir.model.access.csv',
'beescoop_pos.xml',
],
# only loaded in demonstration mode
'demo': [
'demo.xml',
],
}

33
beescoop_pos/beescoop_pos.py

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

17
beescoop_pos/beescoop_pos.xml

@ -0,0 +1,17 @@
<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">
<field name="bill_value" />
</field>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save