Skip to content

Commit

Permalink
Merge PR #3086 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by rvalyi
  • Loading branch information
OCA-git-bot committed May 18, 2024
2 parents 7b0de6b + 9e5945f commit 87e1046
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion l10n_br_contract/models/contract_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def default_get(self, fields_list):
if company_id:
company_id = self.env["res.company"].browse(company_id)
else:
company_id = self.env.user.company_id
company_id = self.env.company
if contract_type == "sale":
fiscal_operation_id = company_id.contract_sale_fiscal_operation_id
else:
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_delivery/models/fiscal_document_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FiscalDocumentMixin(models.AbstractModel):
_inherit = "l10n_br_fiscal.document.mixin.fields"

def _get_default_incoterm(self):
return self.env.user.company_id.incoterm_id
return self.env.company.incoterm_id

# Esta sendo implementado aqui para existir nos objetos herdados
incoterm_id = fields.Many2one(
Expand Down
8 changes: 4 additions & 4 deletions l10n_br_nfe/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _inverse_nfe40_Id(self):
selection=NFE_TRANSMISSIONS,
string="NFe Transmission",
copy=False,
default=lambda self: self.env.user.company_id.nfe_transmission,
default=lambda self: self.env.company.nfe_transmission,
)

# <cDV>0</cDV> TODO
Expand All @@ -258,7 +258,7 @@ def _inverse_nfe40_Id(self):
selection=NFE_ENVIRONMENTS,
string="NFe Environment",
copy=False,
default=lambda self: self.env.user.company_id.nfe_environment,
default=lambda self: self.env.company.nfe_environment,
)

nfe40_finNFe = fields.Selection(related="edoc_purpose")
Expand Down Expand Up @@ -730,7 +730,7 @@ def _build_many2one(self, comodel, vals, new_value, key, value, path):
value.enderEmit, path=path
)
new_value.update(enderEmit_value)
company_cnpj = self.env.user.company_id.cnpj_cpf.translate(
company_cnpj = self.env.company.cnpj_cpf.translate(
str.maketrans("", "", string.punctuation)
)
emit_cnpj = new_value.get("nfe40_CNPJ").translate(
Expand All @@ -748,7 +748,7 @@ def _build_many2one(self, comodel, vals, new_value, key, value, path):
value.enderDest, path=path
)
new_value.update(enderDest_value)
company_cnpj = self.env.user.company_id.cnpj_cpf.translate(
company_cnpj = self.env.company.cnpj_cpf.translate(
str.maketrans("", "", string.punctuation)
)
dest_cnpj = new_value.get("nfe40_CNPJ").translate(
Expand Down
8 changes: 4 additions & 4 deletions l10n_br_nfe/wizards/l10n_br_account_nfe_export_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ class L10nBrAccountNfeExportInvoice(models.TransientModel):
_description = "Export eletronic invoice"

def _default_file_type(self):
return self.env.user.company_id.file_type
return self.env.company.file_type

def _default_nfe_environment(self):
return self.env.user.company_id.nfe_environment
return self.env.company.nfe_environment

def _default_export_folder(self):
return self.env.user.company_id.nfe_export_folder
return self.env.company.nfe_export_folder

def _default_sign_xml(self):
return self.env.user.company_id.sign_xml
return self.env.company.sign_xml

name = fields.Char(string="Nome", size=255)

Expand Down
2 changes: 1 addition & 1 deletion l10n_br_repair/models/fiscal_line_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FiscalLineMixin(models.AbstractModel):

@api.model
def _default_fiscal_operation(self):
return self.env.user.company_id.repair_fiscal_operation_id
return self.env.company.repair_fiscal_operation_id

fiscal_operation_id = fields.Many2one(
comodel_name="l10n_br_fiscal.operation",
Expand Down
4 changes: 2 additions & 2 deletions l10n_br_repair/models/repair_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class RepairOrder(models.Model):

@api.model
def _default_fiscal_operation(self):
return self.env.user.company_id.repair_fiscal_operation_id
return self.env.company.repair_fiscal_operation_id

@api.model
def _default_copy_note(self):
return self.env.user.company_id.copy_repair_quotation_notes
return self.env.company.copy_repair_quotation_notes

@api.model
def _fiscal_operation_domain(self):
Expand Down

0 comments on commit 87e1046

Please sign in to comment.