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

iitialisation

parent
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
.*
*.pyc
!.gitignore
\ No newline at end of file
Ce diff est replié.
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl
:alt: License: AGPL-3
==================
Finacoop - Account
==================
Description
===========
Ce module hérite du module *account* et ajoute les fonctionnalités suivantes pour Finacoop :
* Ajout du template de mail de factures
* Hérite la fonction *action_invoice_sent* de la classe *account_invoice* pour définir le template par défaut
* Modifie la treeview des factures pour mettre en gras & italique les factures envoyées
* Ajoute un domaine sur le *partner_id* sur *is_company* et *customer* dans la formview des factures
* Ajoute *sent_date* sur la formview correspondant à la date d'envoi de la facture par ail ou de la première impression pdf
Credits
=======
Contributors
------------
* Benjamin Rivier <benjami@le-filament.com>
Maintainer
----------
.. image:: https://le-filament.com/images/logo-lefilament.png
:alt: Le Filament
:target: https://le-filament.com
This module is maintained by Le Filament
# -*- coding: utf-8 -*-
# © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
\ No newline at end of file
# -*- coding: utf-8 -*-
# © 2017 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Finacoop - Account',
'version': '10.0.1.0',
'author': 'LE FILAMENT',
'license': 'AGPL-3',
'category': 'Finacoop',
'depends': ['account',],
'contributors': [
'Benjamin Rivier <benjami@le-filament.com>',
'Juliana Poudou <juliana@le-filament.com>',
],
'website': 'http://www.le-filament.com',
'data': [
'data/mail_template.xml',
'views/account_invoice.xml',
],
'qweb': [
'static/src/xml/*.xml',
],
}
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Mail template are declared in a NOUPDATE block
so users can freely customize/delete them -->
<data noupdate="0">
<!--Email template -->
<record id="finacoop_account.email_template_finacoop_invoice" model="mail.template">
<field name="name">Finacoop - Mail Facture</field>
<field name="email_from">facturation@finacoop.fr</field>
<field name="subject">Finacoop - Service facturation (Facture ${object.number or 'n/a'})</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="False"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">${object.partner_id.display_name} - Facture ${object.number or ''}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html">
<![CDATA[
% set access_action = object.get_access_action()
% set access_url = access_action['type'] == 'ir.actions.act_url' and access_action['url'] or '/report/pdf/account.report_invoice/' + str(object.id)
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
% set payment = object.payment_mode_id.name
<p>Bonjour,</p>
<br/>
<p>Merci de trouver ci-joint la facture pour ${object.partner_id.name} : <br/>
- Facture ${object.number} à régler par
% if payment:
${payment}
% else:
virement
% endif
<br/>
% if is_online:
- <a href="${access_url}" style="" >Voir ma facture</a>
% endif
</p>
<br/>
<p>Vous en souhaitant bonne réception,</p>
<br/>
<p>Coop'</p>
<br/>
<img src="/finacoop_account/static/src/img/logo.png" alt="Logo Finacoop" />
<p><b>Service Comptabilité</b></p>
<p style="font-size: 10px; color: #aaa;">
Adresse : 24 rue de l'Est 75020 PARIS
</p>
<p style="font-size: 10px; color: #aaa;">
<a href="http://www.finacoop.fr/">finacoop.fr </a><br/>
<a href="https://twitter.com/FINACOOP_">Twitter </a> | <a href="https://www.facebook.com/FINACOOP">Facebook</a> | <a href="https://www.linkedin.com/company/finacoop">LinkedIn</a> | <a href="http://www.dailymotion.com/FINACOOP">Dailymotion</a>
</p>
]]>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
# -*- coding: utf-8 -*-
# © 2018 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_invoice
Fichier ajouté
# -*- coding: utf-8 -*-
# © 2019 Le Filament (http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models, api
class AccountInvoice(models.Model):
_inherit = "account.invoice"
sent_date = fields.Datetime(string="Facture envoyé le", compute="_compute_sent_date", store=True)
@api.depends('sent')
@api.multi
def _compute_sent_date(self):
for invoice in self:
if invoice.sent:
invoice.sent_date = fields.Datetime.now()
@api.multi
def action_invoice_sent(self):
res = super(AccountInvoice, self).action_invoice_sent()
template = self.env.ref('finacoop_account.email_template_finacoop_invoice', False)
res['context']['default_template_id']=template and template.id or False
res['context']['custom_layout']=""
return res
Fichier ajouté
static/description/icon.png

11,4 ko

static/src/img/logo.png

14,2 ko

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="invoice_tree_inhrited" model="ir.ui.view">
<field name="name">account.invoice.view.tree</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="decoration-it">sent == True</attribute>
<attribute name="decoration-bf">sent == True</attribute>
<attribute name="decoration-muted">sent == True</attribute>
</xpath>
<xpath expr="//field[@name='state']" position="after">
<field name="sent" />
</xpath>
</field>
</record>
<record id="invoice_form_inhrited" model="ir.ui.view">
<field name="name">account.invoice.view.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="domain">[('is_company','=',True), ('customer','=',True)]</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="after">
<field name="sent_date" attrs="{ 'invisible': [('sent','=',False)] }" />
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
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