module can be installd + format
This commit is contained in:
parent
c21103cab7
commit
cd2bdd2748
@ -11,13 +11,13 @@ class AccountInvoice(models.Model):
|
||||
error_message = ""
|
||||
if any(not so.contract_annex_id.contract_id for so in sale_order_ids):
|
||||
error_message = _("There is a Sale order without binding contract.")
|
||||
if any(not so.contract_annex_id for so in sale_order_ids):
|
||||
if any(not so.contract_annex_id for so in sale_order_ids):
|
||||
error_message = _("There is a Sale order without annex.")
|
||||
if error_message:
|
||||
raise UserError(error_message)
|
||||
|
||||
def action_invoice_print(self):
|
||||
'''
|
||||
"""
|
||||
for so in self.env["sale.order"].search([]):
|
||||
if self.id in so.invoice_ids.ids:
|
||||
order = so
|
||||
@ -32,16 +32,16 @@ class AccountInvoice(models.Model):
|
||||
)
|
||||
)
|
||||
self.sent = True
|
||||
'''
|
||||
"""
|
||||
|
||||
sale_orders_ids = self.env["sale.order"].search([
|
||||
("invoice_ids", "in", self.ids)
|
||||
])
|
||||
sale_orders_ids = self.env["sale.order"].search(
|
||||
[("invoice_ids", "in", self.ids)]
|
||||
)
|
||||
if not sale_orders_ids:
|
||||
return super().action_invoice_print()
|
||||
|
||||
self.check_contract_presence(sale_orders_ids)
|
||||
self.filtered(lambda inv: not inv.is_move_sent).write({'is_move_sent': True})
|
||||
self.filtered(lambda inv: not inv.is_move_sent).write({"is_move_sent": True})
|
||||
|
||||
view = self.env.ref(
|
||||
"{}.res_partner_wizard_print_document_view".format(MODULE_NAME)
|
||||
|
@ -3,13 +3,19 @@ import datetime
|
||||
from odoo import _, fields, models
|
||||
|
||||
from ..utils import MODULE_NAME
|
||||
|
||||
# from ..utils.misc import Extension, IDocument
|
||||
|
||||
|
||||
class PartnerContract(models.Model): #, IDocument, Extension):
|
||||
class PartnerContract(models.Model): # , IDocument, Extension):
|
||||
_name = "res.partner.contract"
|
||||
_description = "Contract"
|
||||
_inherit = ["mail.thread", "mail.activity.mixin", "mail.followers", "client_contracts.utils"]
|
||||
_inherit = [
|
||||
"mail.thread",
|
||||
"mail.activity.mixin",
|
||||
"mail.followers",
|
||||
"client_contracts.utils",
|
||||
]
|
||||
|
||||
def _get_default_name(self):
|
||||
"""Returns name format `№YYMM-D-N`,
|
||||
|
@ -3,10 +3,11 @@ import math
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
from ..utils import MODULE_NAME
|
||||
|
||||
# from ..utils.misc import Extension, IDocument
|
||||
|
||||
|
||||
class ContractOrderAnnex(models.Model): # , IDocument, Extension):
|
||||
class ContractOrderAnnex(models.Model): # , IDocument, Extension):
|
||||
_name = "res.partner.contract.annex"
|
||||
_inherit = ["client_contracts.utils"]
|
||||
_description = "Contract Annex"
|
||||
|
@ -1,7 +1,8 @@
|
||||
import datetime as dt
|
||||
|
||||
# import inspect
|
||||
|
||||
from odoo import models # , fields
|
||||
from odoo import models # , fields
|
||||
from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
|
||||
|
||||
|
||||
|
@ -6,12 +6,13 @@ from odoo.exceptions import ValidationError
|
||||
|
||||
from ..utils import MODULE_NAME
|
||||
from ..utils.docxtpl import get_document_from_values_stream
|
||||
|
||||
# from ..utils.misc import Extension
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ContractWizard(models.TransientModel): #, Extension):
|
||||
class ContractWizard(models.TransientModel): # , Extension):
|
||||
_name = "res.partner.contract.wizard"
|
||||
_inherit = ["client_contracts.utils"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user