mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] Add link to contract in invoice chatter
This commit is contained in:
committed by
Pedro M. Baeza
parent
d381d11917
commit
e79298dfb8
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Recurring - Contracts Management",
|
"name": "Recurring - Contracts Management",
|
||||||
"version": "15.0.1.5.1",
|
"version": "15.0.1.5.2",
|
||||||
"category": "Contract Management",
|
"category": "Contract Management",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "Tecnativa, ACSONE SA/NV, Odoo Community Association (OCA)",
|
"author": "Tecnativa, ACSONE SA/NV, Odoo Community Association (OCA)",
|
||||||
|
|||||||
@@ -604,9 +604,28 @@ class ContractContract(models.Model):
|
|||||||
partner_ids=partner_ids.ids
|
partner_ids=partner_ids.ids
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _add_contract_origin(self, invoices):
|
||||||
|
for item in self:
|
||||||
|
for move in invoices & item._get_related_invoices():
|
||||||
|
move.message_post(
|
||||||
|
body=(
|
||||||
|
_(
|
||||||
|
(
|
||||||
|
"%(msg)s by contract <a href=# data-oe-model=contract.contract"
|
||||||
|
" data-oe-id=%(contract_id)d>%(contract)s</a>."
|
||||||
|
),
|
||||||
|
msg=move._creation_message(),
|
||||||
|
contract_id=item.id,
|
||||||
|
contract=item.display_name,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def _recurring_create_invoice(self, date_ref=False):
|
def _recurring_create_invoice(self, date_ref=False):
|
||||||
invoices_values = self._prepare_recurring_invoices_values(date_ref)
|
invoices_values = self._prepare_recurring_invoices_values(date_ref)
|
||||||
moves = self.env["account.move"].create(invoices_values)
|
moves = self.env["account.move"].create(invoices_values)
|
||||||
|
self._add_contract_origin(moves)
|
||||||
self._invoice_followers(moves)
|
self._invoice_followers(moves)
|
||||||
self._compute_recurring_next_date()
|
self._compute_recurring_next_date()
|
||||||
return moves
|
return moves
|
||||||
|
|||||||
Reference in New Issue
Block a user