[MERGE]:lp:~openerp-dev/openobject-addons/trunk-form-add-topbar-apa-account_payment-mma

bzr revid: apa@tinyerp.com-20120504054643-xk9kaum4k4h9flih
This commit is contained in:
Amit Patel (OpenERP) 2012-05-04 11:16:43 +05:30
commit 12bf72b0b3
2 changed files with 14 additions and 10 deletions

View File

@ -92,8 +92,8 @@ class payment_order(osv.osv):
'mode': fields.many2one('payment.mode', 'Payment mode', select=True, required=1, states={'done': [('readonly', True)]}, help='Select the Payment Mode to be applied.'),
'state': fields.selection([
('draft', 'Draft'),
('open', 'Confirmed'),
('cancel', 'Cancelled'),
('open', 'Confirmed'),
('done', 'Done')], 'State', select=True,
help='When an order is placed the state is \'Draft\'.\n Once the bank is confirmed the state is set to \'Confirmed\'.\n Then the order is paid the state is \'Done\'.'),
'line_ids': fields.one2many('payment.line', 'order_id', 'Payment lines', states={'done': [('readonly', True)]}),

View File

@ -100,8 +100,18 @@
<field name="model">payment.order</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Payment order">
<group col="6" colspan="4">
<form layout="manual">
<div class="oe_form_topbar">
<button name="open" states="draft" string="Confirm Payments" icon="gtk-apply"/>
<button name="set_done" states="open" string="Make Payments" type="object" icon="gtk-execute"/>
<button name="set_to_draft" states="cancel" string="Set to draft" type="object" icon="gtk-convert"/>
<button name="cancel" states="draft,open" string="Cancel" icon="gtk-cancel"/>
<div class="oe_right">
<field name="state" select="1" widget="statusbar" nolabel="1" statusbar_visible="draft,open"/>
</div>
</div>
<sheet string="Payment order" layout="auto">
<group col="6" colspan="4" class="oe_form_header">
<field name="reference"/>
<field name="mode" widget='selection'/>
<field name="user_id"/>
@ -162,13 +172,7 @@
</field>
<field name="date_created"/>
<field name="date_done"/>
<field name="state" readonly="1" select="1"/>
<group col="4" colspan="2">
<button name="cancel" states="draft,open" string="Cancel" icon="gtk-cancel"/>
<button name="open" states="draft" string="Confirm Payments" icon="gtk-apply"/>
<button name="set_done" states="open" string="Make Payments" type="object" icon="gtk-execute"/>
<button name="set_to_draft" states="cancel" string="Set to draft" type="object" icon="gtk-convert"/>
</group>
</sheet>
</form>
</field>
</record>