[IMP]: fix the problem of account_receivable and remove the Finish button form pos_payment

bzr revid: sbh@tinyerp.com-20100401111029-w887md3tu0o1xlbl
This commit is contained in:
sbh (Open ERP)
2010-04-01 16:40:29 +05:30
parent ef2ade0632
commit e542e8adc7
4 changed files with 10 additions and 15 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ class pos_company_discount(osv.osv):
'company_discount': fields.float('Max Discount(%)', digits=(16,2)),
'max_diff': fields.float('Max Difference for Cashboxes', digits=(16,2)),
'account_receivable': fields.many2one('account.account',
'Default Receivable', required=True, states={'draft': [('readonly', False)]}),
'Default Receivable', states={'draft': [('readonly', False)]}),
}
pos_company_discount()
+1 -1
View File
@@ -663,7 +663,7 @@ invoiced
<page string="Other">
<field name="company_discount" colspan="4"/>
<field name="max_diff" colspan="4"/>
<field name="account_receivable" colspan="4"/>
<field name="account_receivable" required="1" colspan="4"/>
</page>
</notebook>
</field>
+4 -9
View File
@@ -53,15 +53,16 @@ class pos_make_payment(osv.osv_memory):
else:
journal = None
order = self.pool.get('pos.order').browse(cr, uid, record_id, context)
order_obj=self.pool.get('pos.order')
order = order_obj.browse(cr, uid, record_id, context)
#get amount to pay
amount = order.amount_total - order.amount_paid
if amount <= 0.0:
context.update({'flag': True})
self.pool.get('pos.order').action_paid(cr, uid, [record_id], context)
order_obj.action_paid(cr, uid, [record_id], context)
elif order.amount_paid > 0.0:
self.pool.get('pos.order').write(cr, uid, [record_id], {'state': 'advance'})
order_obj.write(cr, uid, [record_id], {'state': 'advance'})
invoice_wanted_checked = False
@@ -183,12 +184,6 @@ class pos_make_payment(osv.osv_memory):
'datas': datas,
}
def trigger_wkf(self, cr, uid, data, context):
record_id = context and context.get('active_id', False)
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'pos.order', record_id, 'payment', cr)
return {}
_columns = {
'journal': fields.selection(pos_box_entries.get_journal, "Journal", required=True),
'product_id': fields.many2one('product.product', "Acompte"),
+4 -4
View File
@@ -24,10 +24,10 @@
<field name="product_id" attrs="{'required':[('is_acc', '=', True)]}" domain="[('type','=','service')]"/>
</group>
<newline/>
<separator orientation="vertical"/>
<button icon='gtk-cancel' special="cancel" string="Cancel" />
<button name="trigger_wkf" string="Finish" colspan="1" type="object" icon="gtk-ok"/>
<button name="check" string="Make Payment" colspan="1" type="object" icon="gtk-ok"/>
<group col="2" colspan="4">
<button icon='gtk-cancel' special="cancel" string="Cancel" />
<button name="check" string="Make Payment" colspan="1" type="object" icon="gtk-ok"/>
</group>
</group>
</form>
</field>