[IMP] sale: Added string for Quotation and Sales orders list view
- Replaced order date by confirmation date in sales order list view - Added confirmation date in Sales order PDF report when it is not in 'draft' or 'sent' state - Calculation of expected delivery date should be based on sale order date
This commit is contained in:
@@ -639,7 +639,7 @@ class SaleOrderLine(models.Model):
|
||||
return {
|
||||
'name': self.name,
|
||||
'origin': self.order_id.name,
|
||||
'date_planned': datetime.strptime(self.order_id.date_order, DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(days=self.customer_lead),
|
||||
'date_planned': datetime.strptime(self.order_id.confirmation_date, DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(days=self.customer_lead),
|
||||
'product_id': self.product_id.id,
|
||||
'product_qty': self.product_uom_qty,
|
||||
'product_uom': self.product_uom.id,
|
||||
|
||||
@@ -40,9 +40,12 @@
|
||||
<strong>Your Reference:</strong>
|
||||
<p t-field="doc.client_order_ref"/>
|
||||
</div>
|
||||
<div t-if="doc.date_order" class="col-xs-3">
|
||||
<strong t-if="doc.state not in ['draft','sent']">Date Ordered:</strong>
|
||||
<strong t-if="doc.state in ['draft','sent']">Quotation Date:</strong>
|
||||
<div t-if="doc.confirmation_date and doc.state not in ['draft','sent']" class="col-xs-3">
|
||||
<strong>Date Ordered:</strong>
|
||||
<p t-field="doc.confirmation_date"/>
|
||||
</div>
|
||||
<div t-if="doc.date_order and doc.state in ['draft','sent']" class="col-xs-3">
|
||||
<strong>Quotation Date:</strong>
|
||||
<p t-field="doc.date_order"/>
|
||||
</div>
|
||||
<div t-if="doc.user_id.name" class="col-xs-3">
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<tree string="Sales Orders" decoration-bf="message_needaction==True" decoration-muted="state=='cancel'">
|
||||
<field name="message_needaction" invisible="1"/>
|
||||
<field name="name" string="Order Number"/>
|
||||
<field name="date_order"/>
|
||||
<field name="confirmation_date" string="Order Date"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="amount_total" sum="Total Tax Included" widget="monetary"/>
|
||||
@@ -130,7 +130,7 @@
|
||||
<tree string="Quotation" class="o_sale_order" decoration-bf="message_needaction==True" decoration-muted="state=='cancel'">
|
||||
<field name="message_needaction" invisible="1"/>
|
||||
<field name="name" string="Quotation Number"/>
|
||||
<field name="date_order"/>
|
||||
<field name="date_order" string="Quotation Date"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="amount_total" sum="Total Tax Included" widget="monetary"/>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_order" position="after">
|
||||
<field name="confirmation_date" position="after">
|
||||
<field name="requested_date"/>
|
||||
<field name="commitment_date"/>
|
||||
</field>
|
||||
|
||||
@@ -162,7 +162,7 @@ class SaleOrderLine(models.Model):
|
||||
@api.multi
|
||||
def _prepare_order_line_procurement(self, group_id=False):
|
||||
vals = super(SaleOrderLine, self)._prepare_order_line_procurement(group_id=group_id)
|
||||
date_planned = datetime.strptime(self.order_id.date_order, DEFAULT_SERVER_DATETIME_FORMAT)\
|
||||
date_planned = datetime.strptime(self.order_id.confirmation_date, DEFAULT_SERVER_DATETIME_FORMAT)\
|
||||
+ timedelta(days=self.customer_lead or 0.0) - timedelta(days=self.order_id.company_id.security_lead)
|
||||
vals.update({
|
||||
'date_planned': date_planned.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
|
||||
|
||||
Reference in New Issue
Block a user