[12.0][ADD] stock_demand_estimate_matrix

This commit is contained in:
Lois Rilo
2019-12-24 17:57:04 +01:00
committed by davidborromeo
parent 85583c7c0c
commit c005aca5db
19 changed files with 1258 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class DateRange(models.Model):
_inherit = "date.range"
days = fields.Integer(
string="Days between dates",
compute="_compute_days",
readonly=True,
)
@api.multi
@api.depends("date_start", "date_end")
def _compute_days(self):
for rec in self.filtered(lambda x: x.date_start and x.date_end):
rec.days = abs((
rec.date_end -
rec.date_start
).days) + 1