Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: close current issue on lokavaluto addons (lcc_member, lcc_app_connection ..) #207

Merged
merged 9 commits into from
May 16, 2022
2 changes: 2 additions & 0 deletions l10n_fr_lcc_members/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models
89 changes: 89 additions & 0 deletions l10n_fr_lcc_members/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"name": "l10n_fr_lcc_members",
"summary": """
French default params for lcc
""",
"description": """
::image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===================
l10n_fr_lcc_members
===================

Module add some default setup for french lcc company

Installation
============

Just install l10n_fr_lcc_members, all dependencies will be installed by default.

Configuration
=============

No configuration needed on this addon.

Usage
=====

Details TODO

Known issues / Roadmap
======================

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/Lokavaluto/lokavaluto-addons/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Images
------

* Lokavaluto: `Icon <https://lokavaluto.fr/web/image/res.company/1/logo?unique=f3db262>`_.

Contributors
------------

* Stéphan SAINLEGER <https://github.com/stephansainleger>
* Nicolas JEUDY <https://github.com/njeudy>
* Lokavaluto Teams

Funders
-------

The development of this module has been financially supported by:

* Lokavaluto (https://lokavaluto.fr)
* Mycéliandre (https://myceliandre.fr)
* Elabore (https://elabore.coop)

Maintainer
----------

This module is maintained by LOKAVALUTO.

LOKAVALUTO, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and ecosystem for local complementary currency organizations.

""",
"author": "Lokavaluto",
"website": "https://lokavaluto.fr",
"category": "Accounting",
"version": "12.0.1.0.1",
# any module necessary for this one to work correctly
"depends": ["base", "account"],
# always loaded
"data": [
"views/account_journal.xml",
"report/invoice_report_templates.xml",
],
# only loaded in demonstration mode
"demo": [],
}
97 changes: 97 additions & 0 deletions l10n_fr_lcc_members/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_fr_lcc_members
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-09 13:44+0000\n"
"PO-Revision-Date: 2022-05-09 13:44+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "<strong>Invoice Date:</strong>"
msgstr "<strong>Date de la facture :</strong>"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "<strong>Receipt Date:</strong>"
msgstr "<strong>Date du reçu:</strong>"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "Cancelled Invoice"
msgstr "Facture annulée"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "Cancelled Receipt"
msgstr "Reçu annulé"

#. module: l10n_fr_lcc_members
#: model:ir.model,name:l10n_fr_lcc_members.model_res_partner
msgid "Contact"
msgstr "Contact"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "Credit Note"
msgstr "Avoir"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "Draft Invoice"
msgstr "Facture en brouillon"

#. module: l10n_fr_lcc_members
#: code:addons/l10n_fr_lcc_members/models/account_invoice.py:17
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
#, python-format
msgid "Draft Receipt"
msgstr "Reçu Brouillon"

#. module: l10n_fr_lcc_members
#: model:ir.model,name:l10n_fr_lcc_members.model_account_invoice
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "Invoice"
msgstr "Facture"

#. module: l10n_fr_lcc_members
#: model:ir.model,name:l10n_fr_lcc_members.model_account_journal
msgid "Journal"
msgstr "Journal"

#. module: l10n_fr_lcc_members
#: model:ir.model.fields,field_description:l10n_fr_lcc_members.field_account_bank_statement_import_journal_creation__is_receipt
#: model:ir.model.fields,field_description:l10n_fr_lcc_members.field_account_journal__is_receipt
msgid "Print Receipt"
msgstr "Imprimer un reçu"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "Receipt"
msgstr "Reçu"

#. module: l10n_fr_lcc_members
#: code:addons/l10n_fr_lcc_members/models/account_invoice.py:20
#, python-format
msgid "Receipt - %s"
msgstr "Reçu - %s"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "Vendor Bill"
msgstr "Facture fournisseur"

#. module: l10n_fr_lcc_members
#: model_terms:ir.ui.view,arch_db:l10n_fr_lcc_members.report_invoice_document_inherit_sale
msgid "Vendor Credit Note"
msgstr "Avoir de fournisseur"

3 changes: 3 additions & 0 deletions l10n_fr_lcc_members/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import account_journal
from . import account_invoice
23 changes: 23 additions & 0 deletions l10n_fr_lcc_members/models/account_invoice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-

from odoo import models, fields, api, _
from odoo.exceptions import UserError


class AccountInvoice(models.Model):
_inherit = "account.invoice"

@api.multi
def _get_report_base_filename(self):
self.ensure_one()
if self.journal_id.is_receipt:
return (
self.type == "out_invoice"
and self.state == "draft"
and _("Draft Receipt")
or self.type == "out_invoice"
and self.state in ("open", "in_payment", "paid")
and _("Receipt - %s") % (self.number)
)
else:
super(AccountInvoice, self)._get_report_base_filename()
10 changes: 10 additions & 0 deletions l10n_fr_lcc_members/models/account_journal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-

from odoo import models, fields, api
from odoo.exceptions import UserError


class AccountJournal(models.Model):
_inherit = "account.journal"

is_receipt = fields.Boolean("Print Receipt")
29 changes: 29 additions & 0 deletions l10n_fr_lcc_members/report/invoice_report_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_invoice_document_inherit_sale" inherit_id="account.report_invoice_document">
<xpath expr="//h2" position="replace">
<h2>
<span t-if="not o.journal_id.is_receipt and o.type == 'out_invoice' and o.state in ('open', 'in_payment', 'paid')">Invoice</span>
<span t-if="not o.journal_id.is_receipt and o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
<span t-if="not o.journal_id.is_receipt and o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
<span t-if="o.journal_id.is_receipt and o.type == 'out_invoice' and o.state in ('open', 'in_payment', 'paid')">Receipt</span>
<span t-if="o.journal_id.is_receipt and o.type == 'out_invoice' and o.state == 'draft'">Draft Receipt</span>
<span t-if="o.journal_id.is_receipt and o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Receipt</span>
<span t-if="o.type == 'out_refund'">Credit Note</span>
<span t-if="o.type == 'in_refund'">Vendor Credit Note</span>
<span t-if="o.type == 'in_invoice'">Vendor Bill</span>
<span t-field="o.number"/>
</h2>
</xpath>
<xpath expr="//div[@name='invoice_date']" position="replace">
<div class="col-auto mw-100 mb-2" t-if="o.journal_id.is_receipt and o.date_invoice" name="invoice_date">
<strong>Receipt Date:</strong>
<p class="m-0" t-field="o.date_invoice"/>
</div>
<div class="col-auto mw-100 mb-2" t-if="not o.journal_id.is_receipt and o.date_invoice" name="invoice_date">
<strong>Invoice Date:</strong>
<p class="m-0" t-field="o.date_invoice"/>
</div>
</xpath>
</template>
</odoo>
16 changes: 16 additions & 0 deletions l10n_fr_lcc_members/views/account_journal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record model="ir.ui.view" id="view_account_journal_form">
<field name="name">account.journal.form</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form" />
<field name="arch" type="xml">
<field name="type" position="after">
<field name="is_receipt" attrs="{'invisible': [('type', '!=', 'sale')]}"/>
</field>
</field>
</record>
</odoo>
5 changes: 0 additions & 5 deletions lcc_cyclos_base/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ class ResConfigSettings(models.TransientModel):
readonly=False,
string="Url for cyclos serveur",
)
cyclos_client_token = fields.Char(
related="company_id.cyclos_client_token",
readonly=False,
string="Client token auth for cyclos server",
)

cyclos_server_login = fields.Char(
related="company_id.cyclos_server_login",
Expand Down
51 changes: 21 additions & 30 deletions lcc_cyclos_base/views/res_config_settings_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,43 @@
<record id="res_config_settings_view_form_cyclos" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.cyclos</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="99"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="priority" eval="99" />
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block" data-string="cyclos" string="Cyclos" data-key="cyclos">
<h2>Cyclos export configuration</h2>
<div class="row mt16 o_settings_container" id="cyclos_selection_settings">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<span class="o_form_label">Cyclos server url</span>
<div class="text-muted">
<field name="cyclos_server_url"/>
</div>
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<span class="o_form_label">Cyclos server url</span>
<div class="text-muted">
<field name="cyclos_server_url" />
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<span class="o_form_label">Cyclos Client Token</span>
<div class="text-muted">
<field name="cyclos_client_token"/>
</div>
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<span class="o_form_label">Cyclos Server Login</span>
<div class="text-muted">
<field name="cyclos_server_login" />
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<span class="o_form_label">Cyclos Server Login</span>
<div class="text-muted">
<field name="cyclos_server_login"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<span class="o_form_label">Cyclos Server Password</span>
<div class="text-muted">
<field name="cyclos_server_password" password="True"/>
</div>
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<span class="o_form_label">Cyclos Server Password</span>
<div class="text-muted">
<field name="cyclos_server_password" password="True" />
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>
</odoo>
Loading