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

[update] remove payment_term_id in cotiz_cg and use "échéancier" to generate invoices

parent a3f42ec7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
2 requêtes de fusion!212.0 dev,!112.0 refactor cotiz
......@@ -19,7 +19,6 @@
"security/ir.model.access.csv",
"views/account_invoice.xml",
"views/account_move.xml",
"views/account_payment_term.xml",
"views/account_payment_order.xml",
"views/account_payment_line.xml",
"views/res_config_settings.xml",
......
......@@ -3,7 +3,6 @@
from . import account_invoice
from . import account_payment_order
from . import account_payment_term
from . import chart_template
from . import res_company
from . import res_config_settings
......
......@@ -75,18 +75,6 @@ class ScopAccountInvoice(models.Model):
# ------------------------------------------------------
# Override Parent
# ------------------------------------------------------
# @api.multi
# def action_invoice_open(self):
# """
# Création d'une ligne dans scop.contribution
# quand une facture cotisation devient valide
# """
# results = super(ScopAccountInvoice, self).action_invoice_open()
# # for inv in self:
# # if inv.is_contribution:
# # inv.set_scop_contribution()
# return results
@api.one
def _get_outstanding_info_JSON(self):
super(ScopAccountInvoice, self)._get_outstanding_info_JSON()
......@@ -119,48 +107,3 @@ class ScopAccountInvoice(models.Model):
'invoice': line.invoice_id.number
})
self.outstanding_credits_debits_widget = json.dumps(info)
# ------------------------------------------------------
# Common Function
# ------------------------------------------------------
# @api.multi
# def set_scop_contribution(self):
# """
# Création d'une ligne dans scop.contribution
# """
# self.ensure_one()
# if self.is_contribution:
# year = self.year
# # Get existing contribution for this year
# contrib_id = self.env['scop.contribution'].search([
# ('partner_id', '=', self.partner_id.id),
# ('year', '=', year),
# ('type_id', '=', self.type_contribution_id.id)
# ])
#
# # Create scop.contribution line if not exists
# # for year, partner and type
# if not contrib_id:
# contrib_line = self.env['scop.contribution'].create({
# 'partner_id': self.partner_id.id,
# 'type_id': self.type_contribution_id.id,
# 'year': self.year,
# 'calculation_date': fields.Datetime.now(),
# 'amount_calculated': self.amount_total,
# 'amount_called': self.amount_total,
# 'spreading': self.nb_quarter,
# 'invoice_id': self.id,
# })
# else:
# contrib_line = self.set_scop_contribution_hook(contrib_id)
# self.contribution_id = contrib_line.id
# return contrib_line
# return False
# def set_scop_contribution_hook(self, contrib_id):
# """
# Function that can be inherited if a contrib line already exists
# :param contrib_id: scop.contribution line
# :return: scop.contribution
# """
# return contrib_id
# Copyright 2020 Le Filament
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountPaymentTerm(models.Model):
_inherit = 'account.payment.term'
is_contribution = fields.Boolean('Conditions de paiement des cotisations')
\ No newline at end of file
......@@ -14,12 +14,6 @@ class ScopCotisationCompany(models.Model):
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(
comodel_name='res.partner.category',
string='Etiquette de cotisation',
......
......@@ -18,14 +18,6 @@ class CotisationsConfigSettings(models.TransientModel):
string='Journal des cotisations',
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(
comodel_name='res.partner.category',
related="company_id.tag_cotiz_id",
......
......@@ -37,12 +37,6 @@ class ScopCotisation(models.AbstractModel):
company_currency_id = fields.Many2one(
comodel_name='res.currency', related='company_id.currency_id',
string="Company Currency", readonly=True)
payment_term_id = fields.Many2one(
comodel_name='account.payment.term',
string="Conditions de paiement",
domain=[('is_contribution', '=', True)],
required=True,
)
date_cotisation = fields.Date(
string="Date calcul cotisation",
help="Date de calcul qui apparaitra sur le bordereau de cotisation"
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Copyright 2020 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<data>
<record id="view_payment_term_form_inherited" model="ir.ui.view">
<field name="name">account.payment.term.form</field>
<field name="model">account.payment.term</field>
<field name="inherit_id" ref="account.view_payment_term_form"/>
<field name="arch" type="xml">
<xpath expr="//group" position="after">
<group name="schedule">
<field name="is_contribution" widget="boolean_toggle"/>
</group>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
......@@ -29,13 +29,6 @@
</div>
<field name="contribution_journal_id" options="{'no_open': True, 'no_create': True}"/>
</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_right_pane">
<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