Skip to content
Extraits de code Groupes Projets
Valider dc2d4b12 rédigé par jordan's avatar jordan
Parcourir les fichiers

[fix] default_payment_term_id in cgscop_cotisation

parent c8c10a2f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,6 +13,13 @@ class ScopCotisationCompany(models.Model): ...@@ -13,6 +13,13 @@ class ScopCotisationCompany(models.Model):
string='Journal des cotisations', string='Journal des cotisations',
domain="[('type', '=', 'sale')]" domain="[('type', '=', 'sale')]"
) )
contribution_default_payment_term_id = fields.Many2one(
comodel_name='account.payment.term',
string="Conditions de paiement par défaut pour les cotisations",
domain=[('is_contribution', '=', True)],
)
tag_cotiz_id = fields.Many2one( tag_cotiz_id = fields.Many2one(
comodel_name='res.partner.category', comodel_name='res.partner.category',
string='Etiquette de cotisation', string='Etiquette de cotisation',
......
...@@ -18,6 +18,14 @@ class CotisationsConfigSettings(models.TransientModel): ...@@ -18,6 +18,14 @@ class CotisationsConfigSettings(models.TransientModel):
string='Journal des cotisations', string='Journal des cotisations',
domain="[('type', '=', 'sale')]") domain="[('type', '=', 'sale')]")
contribution_default_payment_term_id = fields.Many2one(
comodel_name='account.payment.term',
related="company_id.contribution_default_payment_term_id",
readonly=False,
string="Conditions de paiement par défaut pour les cotisations",
domain=[('is_contribution', '=', True)],
)
tag_cotiz_id = fields.Many2one( tag_cotiz_id = fields.Many2one(
comodel_name='res.partner.category', comodel_name='res.partner.category',
related="company_id.tag_cotiz_id", related="company_id.tag_cotiz_id",
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api from odoo import models, fields, api
from odoo.exceptions import UserError
from datetime import date from datetime import date
...@@ -11,6 +10,19 @@ class ScopCotisation(models.AbstractModel): ...@@ -11,6 +10,19 @@ class ScopCotisation(models.AbstractModel):
_name = "scop.cotisation" _name = "scop.cotisation"
_description = "Base des cotisations" _description = "Base des cotisations"
@api.model
def default_get(self, fields):
"""
Attribue la valeur des conditions de paiments par
défault à la base de cotisation
:param fields:
:return:
"""
res = super(ScopCotisation, self).default_get(fields)
res['payment_term_id'] = self.env.user.company_id.\
contribution_default_payment_term_id.id
return res
year = fields.Selection( year = fields.Selection(
[(year, str(year)) for year in range( [(year, str(year)) for year in range(
fields.Datetime.now().year - 1, fields.Datetime.now().year + 2)], fields.Datetime.now().year - 1, fields.Datetime.now().year + 2)],
......
...@@ -29,6 +29,13 @@ ...@@ -29,6 +29,13 @@
</div> </div>
<field name="contribution_journal_id" options="{'no_open': True, 'no_create': True}"/> <field name="contribution_journal_id" options="{'no_open': True, 'no_create': True}"/>
</div> </div>
<div class="o_setting_right_pane">
<label for="contribution_default_payment_term_id"/>
<div class="text-muted">
Conditions de paiement par défault
</div>
<field name="contribution_default_payment_term_id" options="{'no_open': True, 'no_create': True}"/>
</div>
<div class="o_setting_left_pane"/> <div class="o_setting_left_pane"/>
<div class="o_setting_right_pane"> <div class="o_setting_right_pane">
<label for="tag_cotiz_id"/> <label for="tag_cotiz_id"/>
......
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