[IMP] purchase_tender: Improve the view
bzr revid: sbh@tinyerp.com-20100412102328-0ptieg5w1cgetvhm
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
|
||||
<record id="purchase_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_purchase_install_module"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="sequence">2</field>
|
||||
|
||||
</record>
|
||||
</data>
|
||||
|
||||
@@ -31,7 +31,7 @@ class purchase_tender(osv.osv):
|
||||
_columns = {
|
||||
'name': fields.char('Tender Reference', size=32,required=True),
|
||||
'date_start': fields.datetime('Date Start'),
|
||||
'date_end': fields.datetime('Date End'),
|
||||
'date_end': fields.datetime('Date End',readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
'exclusive': fields.boolean('Exclusive', help="If the tender is exclusive, it will cancel all purchase orders when you confirm one of them"),
|
||||
'description': fields.text('Description'),
|
||||
@@ -63,7 +63,7 @@ class purchase_tender(osv.osv):
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
return True
|
||||
def tender_confirm(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'done'}, context=context)
|
||||
self.write(cr, uid, ids, {'state':'done','date_end':time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
|
||||
return True
|
||||
def tender_reset(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state': 'draft'})
|
||||
@@ -84,6 +84,7 @@ class purchase_tender_line(osv.osv):
|
||||
'tender_id' : fields.many2one('purchase.tender','Purchase Tender', ondelete='cascade'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
}
|
||||
|
||||
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
|
||||
|
||||
""" Changes UoM and name if product_id changes.
|
||||
|
||||
@@ -42,13 +42,13 @@
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Products" editable="bottom">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
||||
<field name="product_uom_id"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="product_uom_id"/>
|
||||
</tree>
|
||||
<form string="Products" editable="bottom">
|
||||
<field name="product_id"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="product_uom_id"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user