[IMP] Chnage the boolean require_payment to a selection field + radio button

This commit is contained in:
Yannick Tivisse
2015-08-25 13:52:00 +02:00
parent 74958b1a49
commit ca8b417ded
2 changed files with 10 additions and 4 deletions
+8 -2
View File
@@ -22,7 +22,10 @@ class sale_quote_template(osv.osv):
'note': fields.text('Terms and conditions'),
'options': fields.one2many('sale.quote.option', 'template_id', 'Optional Products Lines', copy=True),
'number_of_days': fields.integer('Quotation Duration', help='Number of days for the validity date computation of the quotation'),
'require_payment': fields.boolean('Immediate Payment', help="Require immediate payment by the customer when validating the order from the website quote"),
'require_payment': fields.selection([
(0, 'Not mandatory on website quote validation'),
(1, 'Immediate after website order validation')
], 'Payment', help="Require immediate payment by the customer when validating the order from the website quote"),
}
def open_template(self, cr, uid, quote_id, context=None):
return {
@@ -146,7 +149,10 @@ class sale_order(osv.osv):
'options' : fields.one2many('sale.order.option', 'order_id', 'Optional Products Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, copy=True),
'amount_undiscounted': fields.function(_get_total, string='Amount Before Discount', type="float", digits=0),
'quote_viewed': fields.boolean('Quotation Viewed'),
'require_payment': fields.boolean('Immediate Payment', help="Require immediate payment by the customer when validating the order from the website quote"),
'require_payment': fields.selection([
(0, 'Not mandatory on website quote validation'),
(1, 'Immediate after website order validation')
], 'Payment', help="Require immediate payment by the customer when validating the order from the website quote"),
}
def _get_template_id(self, cr, uid, context=None):
@@ -44,7 +44,7 @@
</div>
</xpath>
<xpath expr="//field[@name='client_order_ref']" position="after">
<field name="require_payment"/>
<field name="require_payment" widget="radio"/>
<field name="website_description" invisible="1"/>
</xpath>
</field>
@@ -70,7 +70,7 @@
<div id="number_of_days">
<field name="number_of_days" class="oe_inline"/> days
</div>
<field name="require_payment"/>
<field name="require_payment" widget="radio"/>
</group>
</group>
<notebook>