Skip to content

Commit

Permalink
Ajuste nas datas de criação do procurement - Usando data de confirmação
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro committed Aug 7, 2017
1 parent 8ff1146 commit 9dbf372
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
17 changes: 9 additions & 8 deletions br_sale/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ def _prepare_invoice(self):
(6, None, self.fiscal_position_id.fiscal_observation_ids.ids)]
return res

@api.multi
def _prepare_order_line_procurement(self, group_id=False):
vals = super(SaleOrder, self)._prepare_order_line_procurement(
group_id=group_id)
confirm = fields.Date.from_string(self.order_id.confirmation_date)
vals["date_plannned"] = confirm + timedelta(days=self.customer_lead)
return vals

total_bruto = fields.Float(
string='Total Bruto ( = )', readonly=True, compute='_amount_all',
digits=dp.get_precision('Account'), store=True)
Expand Down Expand Up @@ -74,6 +66,15 @@ def _prepare_tax_context(self):
'icms_st_aliquota_deducao': self.icms_st_aliquota_deducao,
}

@api.multi
def _prepare_order_line_procurement(self, group_id=False):
vals = super(SaleOrderLine, self)._prepare_order_line_procurement(
group_id=group_id)

confirm = fields.Date.from_string(self.order_id.confirmation_date)
vals["date_plannned"] = confirm + timedelta(days=self.customer_lead)
return vals

@api.depends('product_uom_qty', 'discount', 'price_unit', 'tax_id',
'icms_st_aliquota_mva', 'incluir_ipi_base',
'icms_aliquota_reducao_base', 'icms_st_aliquota_reducao_base',
Expand Down
21 changes: 10 additions & 11 deletions br_sale_stock/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ def _onchange_despesas_frete_seguro(self):
'outras_despesas': self.total_despesas * percentual
})

@api.multi
def _prepare_order_line_procurement(self, group_id=False):
vals = super(SaleOrderLine, self)._prepare_order_line_procurement(
group_id=group_id)

confirm = fields.Date.from_string(self.order_id.confirmation_date)
date_planned = confirm + timedelta(days=self.customer_lead or 0.0)
date_planned -= timedelta(days=self.order_id.company_id.security_lead)
vals["date_planned"] = date_planned
return vals

total_despesas = fields.Float(
string='Despesas ( + )', default=0.00,
digits=dp.get_precision('Account'),
Expand Down Expand Up @@ -86,6 +75,16 @@ def _prepare_tax_context(self):
})
return res

@api.multi
def _prepare_order_line_procurement(self, group_id=False):
vals = super(SaleOrderLine, self)._prepare_order_line_procurement(
group_id=group_id)
confirm = fields.Date.from_string(self.order_id.confirmation_date)
date_planned = confirm + timedelta(days=self.customer_lead or 0.0)
date_planned -= timedelta(days=self.order_id.company_id.security_lead)
vals["date_planned"] = date_planned
return vals

valor_seguro = fields.Float(
'Seguro', default=0.0, digits=dp.get_precision('Account'))
outras_despesas = fields.Float(
Expand Down

0 comments on commit 9dbf372

Please sign in to comment.