[IMP] point of sale

bzr revid: nel@tinyerp.com-20100621161229-xtb82392avghya68
This commit is contained in:
nel@tinyerp.com 2010-06-21 18:12:29 +02:00
parent c5e5a3b262
commit 2e6ff42f38
13 changed files with 44 additions and 24 deletions

View File

@ -221,7 +221,7 @@ class account_bank_statement(osv.osv):
self.write(cr, uid, ids, {'date':time.strftime("%Y-%m-%d %H:%M:%S"), 'state':'open', 'name':number})
return True
def button_confirm(self, cr, uid, ids, context=None):
def button_confirm(self, cr, uid, ids, context={}):
""" Check the starting and ending detail of statement
@return: True
@ -245,7 +245,7 @@ class account_bank_statement(osv.osv):
self.write(cr, uid, statement.id, {'balance_end_real':Decimal(str(val_statement_line))+Decimal(str(val2)),'closing_date':time.strftime("%Y-%m-%d %H:%M:%S"),'state':'draft'})
# self.write(cr, uid, statement.id, {'balance_end_real':bal_st+val_statement_line,'closing_date':time.strftime("%Y-%m-%d %H:%M:%S"),'state':'draft'})
return super(account_bank_statement, self).button_confirm(cr, uid, ids, context=None)
return super(account_bank_statement, self).button_confirm(cr, uid, ids, context={})
def button_cancel(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'draft'}, context=context)

View File

@ -575,7 +575,7 @@ class pos_order(osv.osv):
val=cr.fetchone()
val=val and val[0] or None
if val:
cr.execute("Update pos_order set date_validation='%s' where id = %d"%(val, order.id))
cr.execute("Update pos_order set date_validation='%s', state_2 ='%s' where id = %d"%(val, 'accepted', order.id))
return True

View File

@ -174,7 +174,7 @@
<menuitem name="Point of Sale" id="menu_point_of_sale" parent="menu_point_root" sequence="1" />
<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="2" />
<menuitem name="Products" id="menu_point_of_sale_product" parent="menu_point_root" sequence="29" />
<menuitem action="product.product_normal_action" id="menu_pos_products" parent="menu_point_of_sale_product" sequence="2" name="Products"/>
@ -860,7 +860,7 @@
</record>
<!-- Miscelleanous Operations/Reporting -->
<menuitem name="Reporting" parent="menu_point_root" id="menu_point_rep" sequence="5"/>
<menuitem name="Reporting" parent="menu_point_root" id="menu_point_rep" sequence="30"/>
<menuitem name="Registers" parent="menu_point_rep" id="menu_point_report_register" sequence="0" />
<menuitem name="Sales" parent="menu_point_rep" id="menu_point_report_sale" sequence="1" />

View File

@ -132,8 +132,7 @@
</tr>
<tr>
<td><para style="P8">[[ repeatIn(o.lines,'line') ]]</para>
<para style="terp_default_9b">[[ len(line.product_id.name) > 39 and line.product_id.name[:39] + '...' or line.product_id.name ]]</para>
<para style="terp_default_9b">[[ line.product_id.name ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][['%.f' % line.qty ]]</para>

View File

@ -14,7 +14,7 @@
<field name="quantity"/>
<button icon='gtk-cancel' name="close_action"
string="Close" type="object" />
<button name="select_product" string="Contiue"
<button name="select_product" string="Continue"
colspan="1" type="object" icon="gtk-ok" />
</group>
</form>

View File

@ -37,14 +37,26 @@ class pos_close_statement(osv.osv_memory):
@return : Blank Dictionary
"""
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
list_statement = []
statement_obj = self.pool.get('account.bank.statement')
journal_obj = self.pool.get('account.journal')
journal_lst = journal_obj.search(cr, uid, [('company_id', '=', company_id), ('auto_cash', '=', True), ('check_dtls', '=', False)])
journal_ids = journal_obj.browse(cr, uid, journal_lst)
for journal in journal_ids:
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)])
statement_obj.button_confirm(cr, uid, ids)
return {}
list_statement = ids
statement_obj.button_confirm(cr, uid, ids, context)
if not list_statement:
return {}
return {
'domain': "[('id','in', list_statement)]",
'name': 'Close Statements',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.bank.statement',
'view_id': False,
'type': 'ir.actions.act_window'
}
pos_close_statement()

View File

@ -9,10 +9,9 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Close Statements">
<label string="Are you sure you want to close the statements ?" colspan="2"/>
<newline/>
<separator string="Are you sure you want to close the statements ?" colspan="4"/>
<button icon='gtk-cancel' special="cancel"
string="No" />
string="No" colspan="1" />
<button name="close_statement" string="Yes"
colspan="1" type="object" icon="gtk-ok"/>
</form>
@ -37,4 +36,4 @@
<field name="target">new</field>
</record>
</data>
</openerp>
</openerp>

View File

@ -37,9 +37,11 @@ class pos_open_statement(osv.osv_memory):
@param context: A standard dictionary
@return : Blank Directory
"""
list_statement = []
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
statement_obj = self.pool.get('account.bank.statement')
singer_obj = self.pool.get('singer.statement')
sequence_obj = self.pool.get('ir.sequence')
journal_obj = self.pool.get('account.journal')
journal_lst = journal_obj.search(cr, uid, [('company_id', '=', company_id), ('auto_cash', '=', True)])
journal_ids = journal_obj.browse(cr, uid, journal_lst)
@ -54,7 +56,6 @@ class pos_open_statement(osv.osv_memory):
cr.execute(sql)
st_id = cr.fetchone()
number = ''
sequence_obj = self.pool.get('ir.sequence')
if journal.statement_sequence_id:
number = sequence_obj.get_id(cr, uid, journal.id)
else:
@ -74,6 +75,7 @@ class pos_open_statement(osv.osv_memory):
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,
@ -86,7 +88,15 @@ class pos_open_statement(osv.osv_memory):
'number': i.number,
'starting_id': statement_id,
})
cr.commit()
return {
'domain': "[('id','in', ["+','.join(map(str,list_statement))+"])]",
'name': 'Open Statement',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.bank.statement',
'view_id': False, # TODO: REFERENCE RIGHT VIEWS
'type': 'ir.actions.act_window'
}
return {}
pos_open_statement()

View File

@ -9,12 +9,11 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Open Statements">
<label string="Are you sure you want to open the statements ?" colspan="2"/>
<newline/>
<separator string="Are you sure you want to open the statements ?" colspan="4"/>
<button icon='gtk-cancel' special="cancel"
string="No" />
<button name="open_statement" string="Yes"
colspan="1" type="object" icon="gtk-ok"/>
type="object" icon="gtk-ok"/>
</form>
</field>
</record>
@ -36,4 +35,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -10,6 +10,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Receipt :">
<separator string="Print the receipt of the sale" colspan="4"/>
<button icon='gtk-cancel' special="cancel"
string="Close" />
<button name="print_report" string="Print Report"

View File

@ -247,7 +247,8 @@ class add_product(osv.osv_memory):
"""
active_id=context.get('active_id', False)
data = self.read(cr, uid, ids)[0]
data = self.read(cr, uid, ids)
data = data and data[0] or False
if active_id:
order_obj = self.pool.get('pos.order')
lines_obj = self.pool.get('pos.order.line')
@ -327,7 +328,6 @@ class add_product(osv.osv_memory):
return_boj=self.pool.get('pos.return')
return_id=return_boj.search(cr,uid,[])
data=return_boj.read(cr,uid,return_id,[])[0]
wf_service = netsvc.LocalService("workflow")
for order_id in order_obj.browse(cr, uid, active_ids, context=context):
prop_ids =property_obj.search(cr, uid, [('name', '=', 'property_stock_customer')])

View File

@ -32,5 +32,5 @@ class picking(report_sxw.rml_parse):
})
report_sxw.report_sxw('report.stock.picking.list','stock.picking','addons/stock/report/picking.rml',parser=picking)
report_sxw.report_sxw('report.stock.packing.list','stock.picking','addons/stock/report/packing.rml',parser=picking)
report_sxw.report_sxw('report.stock.packing.list2','stock.picking','addons/stock/report/packing.rml',parser=picking)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -3,7 +3,7 @@
<data>
<report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Future Stock Forecast"/>
<report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Picking list" rml="stock/report/picking.rml"/>
<report id="report_packing_list" model="stock.picking" name="stock.packing.list" string="Packing list" rml="stock/report/packing.rml"/>
<report id="report_packing_list" model="stock.picking" name="stock.packing.list2" string="Packing list" rml="stock/report/packing.rml"/>
<report id="report_move_labels" model="stock.move" name="stock.move.label" string="Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
<report auto="False" id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Overview" rml="stock/report/lot_overview.rml" groups="base.group_extended"/>
<report auto="False" id="report_lot_location" model="stock.location" name="lot.location" rml="stock/report/lot_location.rml" string="Lots by location"/>