diff --git a/views/scop_cotisation_cg.xml b/views/scop_cotisation_cg.xml index 1df5c47f35d2cf4f4c4c85d9026d2e7a11f54f23..8c0e1a0f697c9c2de08273463c2536344273570e 100644 --- a/views/scop_cotisation_cg.xml +++ b/views/scop_cotisation_cg.xml @@ -66,11 +66,11 @@ <hr/> <button name="add_simul" class="btn btn-outline-info" style="margin-right: 20px; width: 250px;" type="object" string="Globale : CG, UR et Fédération" - attrs="{'invisible': [('state', '!=', 'new')]}" context="{'type_simul': 'all'}"/> + context="{'type_simul': 'all'}"/> <button name="add_simul" class="btn btn-outline-info" style="width: 250px;" type="object" string="CG Scop uniquement" - attrs="{'invisible': [('state', '!=', 'new')]}" context="{'type_simul': 'cgscop'}"/> + context="{'type_simul': 'cgscop'}"/> <field name="simul_ids" mode="tree"/> </page> </notebook> diff --git a/wizard/scop_bordereau_payment_mode_wizard.py b/wizard/scop_bordereau_payment_mode_wizard.py index 45efe0ab20b24c13e42fc35a59855c52e588cedf..e82de50034d79fbd6b8ee2c5b748af1e5a160488 100644 --- a/wizard/scop_bordereau_payment_mode_wizard.py +++ b/wizard/scop_bordereau_payment_mode_wizard.py @@ -40,13 +40,17 @@ class ScopBordereauChangePaymentMode(models.TransientModel): bordereau_id.invoice_ids.update({ 'payment_mode_id': self.payment_mode_id.id, }) - contrib_cg_journal = self.env.user.company_id.contribution_journal_id - contrib_ur_fede_journal = \ - self.env.user.company_id.contribution_ur_or_fede_journal_id + journal_ids = [ + self.env.user.company_id.contribution_journal_id.id, + self.env.user.company_id.journal_fede_com_id.id, + self.env.user.company_id.journal_fede_cae_id.id, + self.env.user.company_id.journal_ur_hdf_id.id, + self.env.user.company_id.journal_ur_med_id.id, + ] + move_line_ids = self.env['account.move.line'].search([ ('partner_id', '=', self.bordereau_id.partner_id.id), - ('journal_id', 'in', ( - contrib_cg_journal.id, contrib_ur_fede_journal.id)), + ('journal_id', 'in', journal_ids), ('full_reconcile_id', '=', False), ('balance', '!=', 0), ('account_id.reconcile', '=', True), diff --git a/wizard/scop_bordereau_refund_wizard.py b/wizard/scop_bordereau_refund_wizard.py index a400e381fd1040d715aa89c98101bcf38bdf72c0..35e9ebbca7dcd2239ca65c805a69b7a616a237bf 100644 --- a/wizard/scop_bordereau_refund_wizard.py +++ b/wizard/scop_bordereau_refund_wizard.py @@ -132,10 +132,10 @@ 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 + journal_ur = self.env.user.company_id.journal_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 + journal_ur = self.env.user.company_id.journal_ur_med_id cotiz_type = { self.env.ref('cgscop_partner.riga_14397').id: @@ -147,20 +147,20 @@ class ScopBordereauRefundWizard(models.TransientModel): 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.user.company_id.journal_fede_com_id, + partner_id.property_account_receivable_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.user.company_id.journal_fede_cae_id, + partner_id.property_account_receivable_id ], self.env.ref('cgscop_partner.riga_14399').id: [ product_ur, - self.env.user.company_id.contribution_ur_or_fede_journal_id, - # account_ur + journal_ur, + partner_id.property_account_receivable_id ], } product = cotiz_type.get(int(self.type_cotiz))[0] diff --git a/wizard/scop_cotisation_cg_regul.py b/wizard/scop_cotisation_cg_regul.py index 95417eee095c2b1bacacffb627a79bcfaad7cdf5..9766ead59bff9c1119ed7d9d87fe249ed17188a7 100644 --- a/wizard/scop_cotisation_cg_regul.py +++ b/wizard/scop_cotisation_cg_regul.py @@ -156,40 +156,40 @@ class ScopCotisationRegul(models.TransientModel): 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 + journal_ur = self.env.user.company_id.journal_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 + journal_ur = self.env.user.company_id.journal_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, - partner_id.property_account_receivable_id.id + self.env.user.company_id.contribution_cg_id, + self.env.user.company_id.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.user.company_id.journal_fede_com_id, + partner_id.property_account_receivable_id.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.user.company_id.journal_fede_cae_id, + partner_id.property_account_receivable_id.id ], self.env.ref('cgscop_partner.riga_14399').id: [ amount_ur, product_ur, - self.env.user.company_id.contribution_ur_or_fede_journal_id, - # account_ur + journal_ur, + partner_id.property_account_receivable_id.id ], }