[IMP] point_of_sale: Add the POS Config object
bzr revid: stw@openerp.com-20120404123114-e557auyszvy4uy3a
This commit is contained in:
parent
819a115bbd
commit
bc05498416
|
@ -33,6 +33,63 @@ import decimal_precision as dp
|
|||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
class pos_config(osv.osv):
|
||||
_name = 'pos.config'
|
||||
|
||||
POS_CONFIG_STATE = [('draft', 'Draft'),('active', 'Active'),('inactive', 'Inactive'),('deprecated', 'Deprecated')]
|
||||
|
||||
_columns = {
|
||||
'name' : fields.char('Name', size=32, select=1, required=True),
|
||||
'journal_ids' : fields.many2many('account.journal', 'pos_config_journal_rel', 'pos_config_id', 'journal_id', 'Payment Methods'),
|
||||
'shop_id' : fields.many2one('sale.shop', 'Shop', required=True, select=1),
|
||||
'journal_id' : fields.many2one('account.journal', 'Journal', required=True, select=1),
|
||||
'profit_account_id' : fields.many2one('account.account', 'Profit Account', required=True, select=1),
|
||||
'loss_account_id' : fields.many2one('account.account', 'Loss Account', required=True, select=1),
|
||||
|
||||
'authorized_cashbox_diff' : fields.integer('Authorized Cashbox Difference (%)'),
|
||||
'authorized_cashbox_diff_fixed' : fields.integer('Authorized Cashbox Difference (Fixed Amount)'),
|
||||
|
||||
|
||||
'iface_self_checkout' : fields.boolean('Self Checkout Mode'),
|
||||
'iface_websql' : fields.boolean('WebSQL (to store data)'),
|
||||
'iface_led' : fields.boolean('LED Interface'),
|
||||
'iface_cashdrawer' : fields.boolean('Cashdrawer Interface'),
|
||||
'iface_payment_terminal' : fields.boolean('Payment Terminal Interface'),
|
||||
'iface_electronic_scale' : fields.boolean('Electronic Scale Interface'),
|
||||
'iface_barscan' : fields.boolean('BarScan Interface'),
|
||||
'iface_vkeyboard' : fields.boolean('Virtual KeyBoard Interface'),
|
||||
|
||||
'state' : fields.selection(POS_CONFIG_STATE, 'State', required=True, readonly=True),
|
||||
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'state' : 'draft',
|
||||
}
|
||||
|
||||
def set_draft(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state' : 'draft'}, context=context)
|
||||
|
||||
def set_active(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state' : 'active'}, context=context)
|
||||
|
||||
def set_inactive(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state' : 'inactive'}, context=context)
|
||||
|
||||
def set_deprecate(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state' : 'deprecated'}, context=context)
|
||||
|
||||
pos_config()
|
||||
|
||||
class pos_session(osv.osv):
|
||||
_name = 'pos.session'
|
||||
|
||||
_columns = {
|
||||
'config_id' : fields.many2one('pos.config', 'Configuration', required=True, select=1),
|
||||
}
|
||||
|
||||
pos_session()
|
||||
|
||||
class pos_config_journal(osv.osv):
|
||||
""" Point of Sale journal configuration"""
|
||||
_name = 'pos.config.journal'
|
||||
|
|
|
@ -790,5 +790,81 @@
|
|||
<menuitem id="menu_point_root_touchscreen"
|
||||
web_icon="images/pos.png" web_icon_hover="images/pos-hover.png" groups="point_of_sale.group_pos_manager,point_of_sale.group_pos_user"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_pos_config_form">
|
||||
<field name="name">pos.config.form.view</field>
|
||||
<field name="model">pos.config</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="PoS Configuration">
|
||||
<field name="name" />
|
||||
<notebook colspan="4">
|
||||
<page string="Payment Methods">
|
||||
<field name="journal_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Accounting">
|
||||
<separator string="Accounting" colspan="4" />
|
||||
<field name="shop_id" widget="selection" />
|
||||
<field name="journal_id" widget="selection" />
|
||||
|
||||
<separator string="Cash Differences" colspan="4" />
|
||||
<field name="profit_account_id" widget="selection" />
|
||||
<field name="loss_account_id" widget="selection" />
|
||||
<field name="authorized_cashbox_diff" />
|
||||
<field name="authorized_cashbox_diff_fixed" />
|
||||
|
||||
</page>
|
||||
<page string="Interfaces">
|
||||
<field name="iface_self_checkout" />
|
||||
<field name="iface_websql" />
|
||||
<field name="iface_led" />
|
||||
<field name="iface_cashdrawer" />
|
||||
<field name="iface_payment_terminal" />
|
||||
<field name="iface_electronic_scale" />
|
||||
<field name="iface_barscan" />
|
||||
<field name="iface_vkeyboard" />
|
||||
</page>
|
||||
|
||||
|
||||
</notebook>
|
||||
|
||||
<group colspan="4" col="6">
|
||||
<field name="state" />
|
||||
<button string="Set to Draft" name="set_draft" type="object" states="deprecated"/>
|
||||
<button string="Set to Active" name="set_active" type="object" states="draft,inactive"/>
|
||||
<button string="Set to Inactive" name="set_inactive" type="object" states="active" />
|
||||
<button string="Set to Deprecated" name="set_deprecate" type="object" states="active,inactive" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_pos_config_tree">
|
||||
<field name="name">pos.config.tree.view</field>
|
||||
<field name="model">pos.config</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="PoS Configuration">
|
||||
<field name="name" />
|
||||
<field name="state" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_pos_config_pos">
|
||||
<field name="name">Point of Sales</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">pos.config</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
parent="menu_point_config_product"
|
||||
action="action_pos_config_pos"
|
||||
id="menu_pos_config_pos"
|
||||
groups="group_pos_manager"/>
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue