some clearance
This commit is contained in:
parent
9069b92175
commit
570c4dd4ad
@ -1,5 +1,3 @@
|
|||||||
import pdb
|
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -44,7 +42,7 @@ class ContractWizard(models.TransientModel):
|
|||||||
selection=[
|
selection=[
|
||||||
("res.partner.contract", "Contract"),
|
("res.partner.contract", "Contract"),
|
||||||
("res.partner.contract.annex", "Contract Annex"),
|
("res.partner.contract.annex", "Contract Annex"),
|
||||||
("sale.order", "Offer")
|
("sale.order", "Offer"),
|
||||||
],
|
],
|
||||||
string="Target",
|
string="Target",
|
||||||
default=_default_target,
|
default=_default_target,
|
||||||
@ -207,7 +205,6 @@ class ContractWizard(models.TransientModel):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
pdb.set_trace()
|
|
||||||
return self.afterload(document_as_attachment)
|
return self.afterload(document_as_attachment)
|
||||||
|
|
||||||
def payload(self):
|
def payload(self):
|
||||||
@ -263,15 +260,15 @@ class ContractWizard(models.TransientModel):
|
|||||||
res_id = self.target.id
|
res_id = self.target.id
|
||||||
if hasattr(self.target, "contract_id"):
|
if hasattr(self.target, "contract_id"):
|
||||||
res_id = self.target.contract_id.id
|
res_id = self.target.contract_id.id
|
||||||
|
target_model = (
|
||||||
|
self.target._name
|
||||||
|
if self.target._name
|
||||||
|
not in ("res.partner.contract", "res.partner.contract.annex")
|
||||||
|
else "res.partner.contract"
|
||||||
|
)
|
||||||
self.env["mail.message"].create(
|
self.env["mail.message"].create(
|
||||||
{
|
{
|
||||||
"model": self.env.context.get(
|
"model": self.env.context.get("attachment_model") or target_model,
|
||||||
"attachment_model", "res.partner.contract"
|
|
||||||
),
|
|
||||||
"res_id": self.env.context.get("attachment_res_id", res_id),
|
"res_id": self.env.context.get("attachment_res_id", res_id),
|
||||||
"message_type": "comment",
|
"message_type": "comment",
|
||||||
"attachment_ids": [(4, result.id, False)],
|
"attachment_ids": [(4, result.id, False)],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user