mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] travis
This commit is contained in:
committed by
Jordi Ballester Alomar
parent
c7143b40f7
commit
d93c47c7fb
@@ -22,7 +22,7 @@ class StockDemandEstimate(models.Model):
|
||||
rec.product_id.uom_id.id, rec.product_uom_qty,
|
||||
rec.product_uom.id)
|
||||
|
||||
def _set_product_qty(self):
|
||||
def _inverse_product_qty(self):
|
||||
raise UserError(_('The requested operation cannot be '
|
||||
'processed because of a programming error '
|
||||
'setting the `product_qty` field instead '
|
||||
@@ -47,7 +47,7 @@ class StockDemandEstimate(models.Model):
|
||||
string="Quantity",
|
||||
digits_compute=dp.get_precision('Product Unit of Measure'))
|
||||
product_qty = fields.Float('Real Quantity', compute='_compute_product_qty',
|
||||
inverse='_set_product_qty', digits=0,
|
||||
inverse='_inverse_product_qty', digits=0,
|
||||
store=True,
|
||||
help='Quantity in the default UoM of the '
|
||||
'product', readonly=True)
|
||||
@@ -77,10 +77,8 @@ class StockDemandEstimate(models.Model):
|
||||
|
||||
# We need only the periods that overlap
|
||||
# the dates introduced by the user.
|
||||
if (
|
||||
date_start <= period_date_start <= date_end
|
||||
or date_start <= period_date_end <= date_end
|
||||
):
|
||||
if (date_start <= period_date_start <= date_end or date_start <=
|
||||
period_date_end <= date_end):
|
||||
overlap_date_start = max(period_date_start, date_start)
|
||||
overlap_date_end = min(period_date_end, date_end)
|
||||
days = (abs(overlap_date_end-overlap_date_start)).days + 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
from openerp import api, fields, models, _
|
||||
import openerp.addons.decimal_precision as dp
|
||||
from openerp.exceptions import ValidationError
|
||||
from openerp.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class StockDemandEstimateSheet(models.TransientModel):
|
||||
@@ -171,7 +171,7 @@ class DemandEstimateWizard(models.TransientModel):
|
||||
def create_sheet(self):
|
||||
self.ensure_one()
|
||||
if not self.product_ids:
|
||||
raise UserError(_('You must select at lease one product.'))
|
||||
raise UserError(_('You must select at least one product.'))
|
||||
|
||||
context = {
|
||||
'default_date_start': self.date_start,
|
||||
|
||||
Reference in New Issue
Block a user