[IMP] confirm date on so

bzr revid: fp@tinyerp.com-20100303135810-mhlbcdgsfw5n12ir
This commit is contained in:
Fabien Pinckaers 2010-03-03 14:58:10 +01:00
parent eda52fba9f
commit a859e3d091
3 changed files with 31 additions and 18 deletions

View File

@ -197,7 +197,8 @@ class sale_order(osv.osv):
('cancel', 'Cancelled')
], 'Order State', readonly=True, help="Gives the state of the quotation or sale order. The exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). The 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True),
'date_order': fields.date('Ordered Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'create_date': fields.date('Creation Date', readonly=True),
'date_confirm': fields.date('confirmation Date', readonly=True),
'user_id': fields.many2one('res.users', 'Salesman', states={'draft': [('readonly', False)]}, select=True),
'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)]}, required=True, change_default=True, select=True),
'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)]}),
@ -361,10 +362,10 @@ class sale_order(osv.osv):
def button_dummy(self, cr, uid, ids, context={}):
return True
#FIXME: the method should return the list of invoices created (invoice_ids)
# and not the id of the last invoice created (res). The problem is that we
# cannot change it directly since the method is called by the sale order
# workflow and I suppose it expects a single id...
#FIXME: the method should return the list of invoices created (invoice_ids)
# and not the id of the last invoice created (res). The problem is that we
# cannot change it directly since the method is called by the sale order
# workflow and I suppose it expects a single id...
def _inv_get(self, cr, uid, order, context={}):
return {}
@ -522,9 +523,9 @@ class sale_order(osv.osv):
'partner_type': 'customer', 'probability': 1.0,\
'planned_revenue': o.amount_untaxed})
if (o.order_policy == 'manual'):
self.write(cr, uid, [o.id], {'state': 'manual'})
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': time.strftime('%Y-%m-%d')})
else:
self.write(cr, uid, [o.id], {'state': 'progress'})
self.write(cr, uid, [o.id], {'state': 'progress', 'date_confirm': time.strftime('%Y-%m-%d')})
self.pool.get('sale.order.line').button_confirm(cr, uid, [x.id for x in o.order_line])
def procurement_lines_get(self, cr, uid, ids, *args):

View File

@ -204,15 +204,29 @@
</group>
</page>
<page string="Other data">
<field groups="base.group_extended" name="incoterm"/>
<field groups="base.group_extended" name="picking_policy" required="True"/>
<field name="user_id"/>
<field name="order_policy" on_change="shipping_policy_change(order_policy)"/>
<field groups="base.group_extended" name="origin"/>
<field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','prepaid'),('order_policy','=','picking')]}"/>
<field name="payment_term" widget="selection"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<group colspan="2" col="2">
<separator string="Logistic" colspan="2"/>
<field groups="base.group_extended" name="incoterm"/>
<field groups="base.group_extended" name="picking_policy" required="True"/>
<field name="order_policy" on_change="shipping_policy_change(order_policy)"/>
<field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','prepaid'),('order_policy','=','picking')]}"/>
</group>
<group colspan="2" col="2">
<separator string="References" colspan="2"/>
<field name="user_id"/>
<field groups="base.group_extended" name="origin"/>
</group>
<group colspan="2" col="2">
<separator string="Conditions" colspan="2"/>
<field name="payment_term" widget="selection"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<group colspan="2" col="2">
<separator string="Dates" colspan="2"/>
<field name="create_date"/>
<field name="date_confirm"/>
</group>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="note" nolabel="1"/>
</page>

View File

@ -58,7 +58,6 @@
<field name="kind">stopall</field>
<field name="action">action_cancel()</field>
</record>
<record id="act_invoice" model="workflow.activity">
<field name="wkf_id" ref="wkf_sale"/>
<field name="name">invoice</field>
@ -85,7 +84,6 @@
<field name="kind">stopall</field>
<field name="action">action_cancel()</field>
</record>
<record id="act_ship" model="workflow.activity">
<field name="wkf_id" ref="wkf_sale"/>
<field name="name">ship</field>