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

[update] add invoice idf in res_partner form view

parent 35893e20
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
from . import controllers from . import controllers
from . import models from . import models
from . import report
from . import wizard from . import wizard
...@@ -23,7 +23,7 @@ class ScopInvoiceIDF(models.Model): ...@@ -23,7 +23,7 @@ class ScopInvoiceIDF(models.Model):
domain=[('is_company', '=', True)]) domain=[('is_company', '=', True)])
journal = fields.Char('Journal') journal = fields.Char('Journal')
writing_date = fields.Date('Date écriture') writing_date = fields.Date('Date écriture')
piece = fields.Integer('Numéro de pièce comptable') acc_doc = fields.Char('Numéro de pièce comptable')
year = fields.Char('Année') year = fields.Char('Année')
type = fields.Selection([ type = fields.Selection([
('inv', 'Facture'), ('inv', 'Facture'),
......
# © 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_invoice_all
# © 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class ScopAccountInvoiceIDFReport(models.Model):
_inherit = "account.invoice.all"
def _select(self):
select_str = super(ScopAccountInvoiceIDFReport, self)._select()
select_str += """
UNION ALL (
SELECT
id,
null as invoice_id,
writing_date as date_invoice,
writing_date as date_due,
acc_doc as number,
company_id,
partner_id,
null as user_id,
debit as amount_untaxed_signed,
debit as amount_total_signed,
amount_residual as residual_company_signed,
null as payment_mode_id,
'out_invoice' as type,
CASE
WHEN amount_residual = 0 THEN 'paid'
ELSE 'open'
END AS state
FROM
scop_invoice_idf
WHERE
type = 'inv'
)
"""
return select_str
...@@ -143,12 +143,14 @@ class ScopImportIDFWizard(models.TransientModel): ...@@ -143,12 +143,14 @@ class ScopImportIDFWizard(models.TransientModel):
lettrage = row['Lettrage N'] lettrage = row['Lettrage N']
year = row['Année'] year = row['Année']
acc_doc = row['Pièce']
values = { values = {
'company_id': company_id.id, 'company_id': company_id.id,
'partner_id': partner_id.id, 'partner_id': partner_id.id,
'journal': journal, 'journal': journal,
'writing_date': writing_date, 'writing_date': writing_date,
'acc_doc': acc_doc,
'name': libelle, 'name': libelle,
'year': year, 'year': year,
'type': line_type, 'type': line_type,
......
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