mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
Add module contract_invoice_start_end_dates
This commit is contained in:
committed by
chafique.delli
parent
c8b6024437
commit
b57e01ba8f
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2019 - Akretion
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class AccountAnalyticAccount(models.Model):
|
||||
_inherit = 'account.analytic.account'
|
||||
|
||||
@api.model
|
||||
def _prepare_invoice_line(self, line, invoice_id):
|
||||
vals = super(AccountAnalyticAccount, self)._prepare_invoice_line(
|
||||
line, invoice_id)
|
||||
if line.product_id.must_have_dates:
|
||||
vals.update({
|
||||
'start_date': self.env.context['date_from'],
|
||||
'end_date': self.env.context['date_to'],
|
||||
})
|
||||
return vals
|
||||
Reference in New Issue
Block a user