[IMP] point_of_sale : Improvements in Cash Registers, Opening Operations
bzr revid: vir@tinyerp.com-20100629133013-24o7e16zi70hp3g5
This commit is contained in:
parent
57c50ea8e9
commit
939510af02
|
@ -174,7 +174,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Daily Operations" id="menu_point_of_sale" parent="menu_point_root" sequence="2" />
|
||||
<menuitem name="Daily Operations" id="menu_point_of_sale" parent="menu_point_root" sequence="3" />
|
||||
<menuitem name="Sales Order" parent="menu_point_of_sale" id="menu_point_ofsale" action="action_pos_pos_form" sequence="1"/>
|
||||
<menuitem name="Products" id="menu_point_of_sale_product" parent="menu_point_root" sequence="15" />
|
||||
|
||||
|
@ -797,8 +797,8 @@
|
|||
action="action_product_output"
|
||||
id="products_for_output_operations"/>
|
||||
|
||||
<menuitem name="Register Management" parent="menu_point_root"
|
||||
id="menu_point_config" sequence="4"/>
|
||||
<!-- <menuitem name="Register Management" parent="menu_point_root"-->
|
||||
<!-- id="menu_point_config" sequence="4"/>-->
|
||||
<menuitem
|
||||
name="Input Operations" parent="menu_point_of_sale"
|
||||
string="Refloat"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
"access_report_sales_by_user_pos_month","report.sales.by.user.pos.month","model_report_sales_by_user_pos_month","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_report_sales_by_margin_pos","report.sales.by.margin.pos","model_report_sales_by_margin_pos","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_report_sales_by_margin_pos_month","report.sales.by.margin.pos.month","model_report_sales_by_margin_pos_month","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_singer_statement","singer.statement","model_singer_statement","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_add_product","pos.add.product ","model_pos_add_product","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_confirm","pos.confirm","model_pos_confirm","point_of_sale.group_pos_user",1,0,0,0
|
||||
"access_pos_discount","pos.discount","model_pos_discount","point_of_sale.group_pos_user",1,0,0,0
|
||||
|
|
|
|
@ -21,17 +21,17 @@
|
|||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Cash Register" parent="point_of_sale.menu_point_root" id="menu_cash_register" sequence="4"/>
|
||||
|
||||
<menuitem
|
||||
name="All Cash Registers"
|
||||
|
||||
<menuitem
|
||||
name="All Cash Registers"
|
||||
parent="menu_cash_register"
|
||||
action="account.action_view_bank_statement_tree"
|
||||
id="menu_all_menu_cash_register"
|
||||
action="account.action_view_bank_statement_tree"
|
||||
id="menu_all_menu_cash_register"
|
||||
sequence="4"
|
||||
/>
|
||||
|
||||
|
||||
<record id="action_new_bank_statement_tree" model="ir.actions.act_window">
|
||||
<field name="name">Cash Register</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -54,14 +54,49 @@
|
|||
<field name="view_id" ref="account.view_bank_statement_form2"/>
|
||||
<field name="act_window_id" ref="action_new_bank_statement_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Open a Cash Registers"
|
||||
|
||||
<record id="action_new_bank_statement_all_tree" model="ir.actions.act_window">
|
||||
<field name="name">All Register</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.bank.statement</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" ref="account.view_bank_statement_tree"/>
|
||||
<field name="search_view_id" ref="account.view_account_bank_statement_filter"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="All Registers"
|
||||
parent="menu_cash_register"
|
||||
action="action_new_bank_statement_tree"
|
||||
id="menu_new_cash_register"
|
||||
action="action_new_bank_statement_all_tree"
|
||||
id="menu_all_menu_all_register"
|
||||
sequence="4"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
name="Open a Cash Registers"
|
||||
parent="menu_cash_register"
|
||||
action="action_new_bank_statement_tree"
|
||||
id="menu_new_cash_register"
|
||||
sequence="3"
|
||||
/>
|
||||
|
||||
<menuitem name="Opening Operations" parent="point_of_sale.menu_point_root"
|
||||
id="menu_point_open_config" sequence="1"/>
|
||||
<menuitem
|
||||
name="Open my Cash Registers" parent="menu_point_open_config"
|
||||
string="Open my Cash Register"
|
||||
action="action_pos_open_statement"
|
||||
id="menu_open_statement" sequence="1" />
|
||||
|
||||
<menuitem name="Closing Operations" parent="point_of_sale.menu_point_root"
|
||||
id="menu_point_close_config" sequence="3"/>
|
||||
|
||||
<menuitem
|
||||
name="Close my Cash Register" parent="menu_point_close_config"
|
||||
string="Close my Cash Register"
|
||||
action="action_pos_close_statement"
|
||||
id="menu_close_statement" sequence="2" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -65,38 +65,42 @@ class pos_open_statement(osv.osv_memory):
|
|||
cr.execute(sql)
|
||||
st_id = cr.fetchone()
|
||||
number = ''
|
||||
if journal.statement_sequence_id:
|
||||
if journal.sequence_id:
|
||||
number = sequence_obj.get_id(cr, uid, journal.id)
|
||||
else:
|
||||
number = sequence_obj.get(cr, uid,
|
||||
'account.bank.statement')
|
||||
|
||||
# statement_id=statement_obj.create(cr,uid,{'journal_id':journal.id,
|
||||
# 'company_id':company_id,
|
||||
# 'user_id':uid,
|
||||
# 'state':'open',
|
||||
# 'name':number
|
||||
# })
|
||||
period = statement_obj._get_period(cr, uid, context) or None
|
||||
cr.execute("INSERT INTO account_bank_statement(journal_id,company_id,user_id,state,name, period_id,date) VALUES(%d,%d,%d,'open','%s',%d,'%s')"%(journal.id, company_id, uid, number, period, time.strftime('%Y-%m-%d %H:%M:%S')))
|
||||
cr.commit()
|
||||
cr.execute("select id from account_bank_statement where journal_id=%d and company_id=%d and user_id=%d and state='open' and name='%s'"%(journal.id, company_id, uid, number))
|
||||
statement_id = cr.fetchone()[0]
|
||||
if st_id:
|
||||
statemt_id = statement_obj.browse(cr, uid, st_id[0])
|
||||
list_statement.append(statemt_id.id)
|
||||
if statemt_id and statemt_id.ending_details_ids:
|
||||
statement_obj.write(cr, uid, [statement_id], {
|
||||
'balance_start': statemt_id.balance_end,
|
||||
'state': 'open',
|
||||
})
|
||||
if statemt_id.ending_details_ids:
|
||||
for i in statemt_id.ending_details_ids:
|
||||
c = singer_obj.create(cr, uid, {
|
||||
'pieces': i.pieces,
|
||||
'number': i.number,
|
||||
'starting_id': statement_id,
|
||||
})
|
||||
|
||||
statement_id=statement_obj.create(cr,uid,{'journal_id':journal.id,
|
||||
'company_id':company_id,
|
||||
'user_id':uid,
|
||||
'state':'open',
|
||||
'name':number
|
||||
})
|
||||
statement_obj.button_open(cr,uid,[statement_id],context)
|
||||
|
||||
# period = statement_obj._get_period(cr, uid, context) or None
|
||||
# cr.execute("INSERT INTO account_bank_statement(journal_id,company_id,user_id,state,name, period_id,date) VALUES(%d,%d,%d,'open','%s',%d,'%s')"%(journal.id, company_id, uid, number, period, time.strftime('%Y-%m-%d %H:%M:%S')))
|
||||
# cr.commit()
|
||||
# cr.execute("select id from account_bank_statement where journal_id=%d and company_id=%d and user_id=%d and state='open' and name='%s'"%(journal.id, company_id, uid, number))
|
||||
# statement_id = cr.fetchone()[0]
|
||||
# print "statement_id",statement_id
|
||||
# if st_id:
|
||||
# statemt_id = statement_obj.browse(cr, uid, st_id[0])
|
||||
# list_statement.append(statemt_id.id)
|
||||
# if statemt_id and statemt_id.ending_details_ids:
|
||||
# statement_obj.write(cr, uid, [statement_id], {
|
||||
# 'balance_start': statemt_id.balance_end,
|
||||
# 'state': 'open',
|
||||
# })
|
||||
# if statemt_id.ending_details_ids:
|
||||
# for i in statemt_id.ending_details_ids:
|
||||
# c = statement_obj.create(cr, uid, {
|
||||
# 'pieces': i.pieces,
|
||||
# 'number': i.number,
|
||||
# 'starting_id': statement_id,
|
||||
# })
|
||||
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_bank_statement_tree')], context=context)
|
||||
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue