Skip to content
Extraits de code Groupes Projets
Valider 7089c7b3 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[fix] change env.user.company_id to env.company

parent dbcc6844
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -288,7 +288,7 @@ class Bordereau(models.Model):
r.amount_total_cotiz = sum(r.invoice_ids.mapped("amount_residual_signed"))
def _compute_recipient(self):
tag_cotiz_id = self.env.user.company_id.tag_cotiz_id
tag_cotiz_id = self.env.company.tag_cotiz_id
for bordereau in self:
child_ids = bordereau.partner_id.child_ids.filtered(
lambda child: (tag_cotiz_id in child.category_id) and child.email
......
......@@ -12,12 +12,12 @@ class ExportJournalWizard(models.TransientModel):
@api.model
def _get_default_company(self):
return self.env.user.company_id
return self.env.company
@api.model
def _get_default_export(self):
export = self.env["export.journal.type"].search(
[("company_id", "=", self.env.user.company_id.id)], limit=1
[("company_id", "=", self.env.company.id)], limit=1
)
return export
......
......@@ -52,9 +52,9 @@ class ScopBordereauChangePaymentMode(models.TransientModel):
"payment_mode_id": self.payment_mode_id.id,
}
)
contrib_cg_journal = self.env.user.company_id.contribution_journal_id
contrib_cg_journal = self.env.company.contribution_journal_id
contrib_ur_fede_journal = (
self.env.user.company_id.contribution_ur_or_fede_journal_id
self.env.company.contribution_ur_or_fede_journal_id
)
move_line_ids = self.env["account.move.line"].search(
[
......
......@@ -80,20 +80,20 @@ class ScopBordereauRefundWizard(models.TransientModel):
ur_hdf = self.env.ref("cgscop_partner.riga_14232").id
if bordereau_id.partner_id.ur_id.id == ur_hdf:
product_ur = self.env.user.company_id.contribution_hdf_id
product_ur = self.env.company.contribution_hdf_id
else: # ur = ur_med
product_ur = self.env.user.company_id.contribution_med_id
product_ur = self.env.company.contribution_med_id
cotiz_type = {
self.env.ref(
"cgscop_partner.riga_14397"
).id: self.env.user.company_id.contribution_cg_id,
).id: self.env.company.contribution_cg_id,
self.env.ref(
"cgscop_partner.riga_14398"
).id: self.env.user.company_id.contribution_fede_com_id,
).id: self.env.company.contribution_fede_com_id,
self.env.ref(
"cgscop_partner.cotiz_fede_cae"
).id: self.env.user.company_id.contribution_fede_cae_id,
).id: self.env.company.contribution_fede_cae_id,
self.env.ref("cgscop_partner.riga_14399").id: product_ur,
}
......@@ -144,31 +144,31 @@ class ScopBordereauRefundWizard(models.TransientModel):
# CREATE REFUND
if partner_id.ur_id.id == ur_hdf:
product_ur = self.env.user.company_id.contribution_hdf_id
account_ur = self.env.user.company_id.receivable_account_ur_hdf_id
product_ur = self.env.company.contribution_hdf_id
account_ur = self.env.company.receivable_account_ur_hdf_id
else: # ur = ur_med
product_ur = self.env.user.company_id.contribution_med_id
account_ur = self.env.user.company_id.receivable_account_ur_med_id
product_ur = self.env.company.contribution_med_id
account_ur = self.env.company.receivable_account_ur_med_id
cotiz_type = {
self.env.ref("cgscop_partner.riga_14397").id: [
self.env.user.company_id.contribution_cg_id,
self.env.user.company_id.contribution_journal_id,
self.env.company.contribution_cg_id,
self.env.company.contribution_journal_id,
partner_id.property_account_receivable_id,
],
self.env.ref("cgscop_partner.riga_14398").id: [
self.env.user.company_id.contribution_fede_com_id,
self.env.user.company_id.contribution_ur_or_fede_journal_id,
self.env.user.company_id.receivable_account_fede_com_id,
self.env.company.contribution_fede_com_id,
self.env.company.contribution_ur_or_fede_journal_id,
self.env.company.receivable_account_fede_com_id,
],
self.env.ref("cgscop_partner.cotiz_fede_cae").id: [
self.env.user.company_id.contribution_fede_cae_id,
self.env.user.company_id.contribution_ur_or_fede_journal_id,
self.env.user.company_id.receivable_account_fede_cae_id,
self.env.company.contribution_fede_cae_id,
self.env.company.contribution_ur_or_fede_journal_id,
self.env.company.receivable_account_fede_cae_id,
],
self.env.ref("cgscop_partner.riga_14399").id: [
product_ur,
self.env.user.company_id.contribution_ur_or_fede_journal_id,
self.env.company.contribution_ur_or_fede_journal_id,
account_ur,
],
}
......
......@@ -171,36 +171,36 @@ class ScopCotisationRegul(models.TransientModel):
ur_hdf = self.env.ref("cgscop_partner.riga_14232").id
if partner_id.ur_id.id == ur_hdf:
amount_ur = self.amount_ur_hdf
product_ur = self.env.user.company_id.contribution_hdf_id
account_ur = self.env.user.company_id.receivable_account_ur_hdf_id
product_ur = self.env.company.contribution_hdf_id
account_ur = self.env.company.receivable_account_ur_hdf_id
else: # ur = ur_med
amount_ur = self.amount_ur_med
product_ur = self.env.user.company_id.contribution_med_id
account_ur = self.env.user.company_id.receivable_account_ur_med_id
product_ur = self.env.company.contribution_med_id
account_ur = self.env.company.receivable_account_ur_med_id
cotiz_type = {
self.env.ref("cgscop_partner.riga_14397").id: [
self.amount_cg,
self.env.user.company_id.contribution_cg_id,
self.env.user.company_id.contribution_journal_id,
self.env.company.contribution_cg_id,
self.env.company.contribution_journal_id,
partner_id.property_account_receivable_id.id,
],
self.env.ref("cgscop_partner.riga_14398").id: [
self.amount_fede_com,
self.env.user.company_id.contribution_fede_com_id,
self.env.user.company_id.contribution_ur_or_fede_journal_id,
self.env.user.company_id.receivable_account_fede_com_id,
self.env.company.contribution_fede_com_id,
self.env.company.contribution_ur_or_fede_journal_id,
self.env.company.receivable_account_fede_com_id,
],
self.env.ref("cgscop_partner.cotiz_fede_cae").id: [
self.amount_fede_cae,
self.env.user.company_id.contribution_fede_cae_id,
self.env.user.company_id.contribution_ur_or_fede_journal_id,
self.env.user.company_id.receivable_account_fede_cae_id,
self.env.company.contribution_fede_cae_id,
self.env.company.contribution_ur_or_fede_journal_id,
self.env.company.receivable_account_fede_cae_id,
],
self.env.ref("cgscop_partner.riga_14399").id: [
amount_ur,
product_ur,
self.env.user.company_id.contribution_ur_or_fede_journal_id,
self.env.company.contribution_ur_or_fede_journal_id,
account_ur,
],
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter