Skip to content

Commit

Permalink
Merge PR #418 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
github-grap-bot committed Jan 24, 2025
2 parents 47cf059 + b7a9065 commit fa8b6fb
Show file tree
Hide file tree
Showing 39 changed files with 369 additions and 0 deletions.
Empty file added fermente_account/README.rst
Empty file.
Empty file added fermente_account/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions fermente_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2025 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Fermente - Account",
"version": "16.0.1.0.0",
"category": "Custom",
"author": "GRAP",
"website": "https://github.com/grap/grap-odoo-custom",
"license": "AGPL-3",
"depends": ["account"],
"data": ["views/view_account_move.xml", "views/view_account_journal.xml"],
}
15 changes: 15 additions & 0 deletions fermente_account/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-21 10:04+0000\n"
"PO-Revision-Date: 2024-06-21 10:04+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"
1 change: 1 addition & 0 deletions fermente_account/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
3 changes: 3 additions & 0 deletions fermente_account/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Customize Odoo / ``account`` module.

* Hide the ``analytic_distribution`` field on all invoice views.
25 changes: 25 additions & 0 deletions fermente_account/views/view_account_journal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="view_account_journal_form" model="ir.ui.view">
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_tree"/>
<field name="arch" type="xml">

<field name="journal_group_ids" position="attributes">
<attribute name="optional">hide</attribute>
</field>

<field name="company_id" position="attributes">
<attribute name="optional">show</attribute>
</field>

</field>
</record>

</odoo>
29 changes: 29 additions & 0 deletions fermente_account/views/view_account_move.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="view_account_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">

<xpath
expr="//field[@name='invoice_line_ids']//tree//field[@name='analytic_distribution']"
position="attributes">
<attribute name="invisible">1</attribute>
</xpath>

<xpath
expr="//field[@name='invoice_line_ids']//form//field[@name='analytic_distribution']"
position="attributes">
<attribute name="invisible">1</attribute>
</xpath>

</field>
</record>

</odoo>
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions fermente_account_invoice_margin/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2025 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Fermente - Account Invoice Margin",
"version": "16.0.1.0.0",
"category": "Custom",
"author": "GRAP",
"website": "https://github.com/grap/grap-odoo-custom",
"license": "AGPL-3",
"depends": ["account_invoice_margin"],
"data": ["views/view_account_move.xml"],
}
15 changes: 15 additions & 0 deletions fermente_account_invoice_margin/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-21 10:04+0000\n"
"PO-Revision-Date: 2024-06-21 10:04+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"
1 change: 1 addition & 0 deletions fermente_account_invoice_margin/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
3 changes: 3 additions & 0 deletions fermente_account_invoice_margin/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Customize OCA / margin-analysis / ``account_invoice_margin`` module.

* Set optional = hide for ``margin`` and ``margin_percent`` fields.
40 changes: 40 additions & 0 deletions fermente_account_invoice_margin/views/view_account_move.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="view_account_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account_invoice_margin.invoice_margin_form_tree"/>
<field name="arch" type="xml">


<xpath
expr="//field[@name='invoice_line_ids']//tree//field[@name='margin']"
position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath
expr="//field[@name='invoice_line_ids']//tree//field[@name='margin_percent']"
position="attributes">
<attribute name="optional">hide</attribute>
</xpath>

<xpath
expr="//field[@name='invoice_line_ids']//form//field[@name='margin']"
position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath
expr="//field[@name='invoice_line_ids']//form//field[@name='margin_percent']"
position="attributes">
<attribute name="optional">hide</attribute>
</xpath>

</field>
</record>

</odoo>
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions fermente_account_invoice_triple_discount/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2025 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Fermente - Account Invoice Triple Discount",
"version": "16.0.1.0.0",
"category": "Custom",
"author": "GRAP",
"website": "https://github.com/grap/grap-odoo-custom",
"license": "AGPL-3",
"depends": ["account_invoice_triple_discount"],
"data": ["views/view_account_move.xml"],
}
15 changes: 15 additions & 0 deletions fermente_account_invoice_triple_discount/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-21 10:04+0000\n"
"PO-Revision-Date: 2024-06-21 10:04+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"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Customize OCA / account-invoicing / ``account_invoice_triple_discount`` module.

* Hide the discount3 field on all invoice views.

* Hide the discount2 field for sale invoices.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="view_account_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account_invoice_triple_discount.invoice_triple_discount_form_view"/>
<field name="arch" type="xml">

<xpath
expr="//field[@name='invoice_line_ids']//tree//field[@name='discount2']"
position="attributes">
<attribute name="attrs">{'column_invisible': [('parent.move_type', 'not in', ('in_invoice', 'in_refund', 'in_receipt'))]}</attribute>
</xpath>

<xpath
expr="//field[@name='invoice_line_ids']//form//field[@name='discount2']"
position="attributes">
<attribute name="attrs">{'column_invisible': [('parent.move_type', 'not in', ('in_invoice', 'in_refund', 'in_receipt'))]}</attribute>
</xpath>

<xpath
expr="//field[@name='invoice_line_ids']//tree//field[@name='discount3']"
position="attributes">
<attribute name="invisible">1</attribute>
</xpath>

<xpath
expr="//field[@name='invoice_line_ids']//form//field[@name='discount3']"
position="attributes">
<attribute name="invisible">1</attribute>
</xpath>

</field>
</record>

</odoo>
Empty file.
1 change: 1 addition & 0 deletions fermente_account_move_name_sequence/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions fermente_account_move_name_sequence/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2025 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Fermente - Account Move Name Sequence",
"version": "16.0.1.0.0",
"category": "Custom",
"author": "GRAP",
"website": "https://github.com/grap/grap-odoo-custom",
"license": "AGPL-3",
"depends": ["account_move_name_sequence"],
"data": ["views/view_account_journal.xml"],
}
15 changes: 15 additions & 0 deletions fermente_account_move_name_sequence/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-21 10:04+0000\n"
"PO-Revision-Date: 2024-06-21 10:04+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"
1 change: 1 addition & 0 deletions fermente_account_move_name_sequence/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_journal
17 changes: 17 additions & 0 deletions fermente_account_move_name_sequence/models/account_journal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (C) 2025 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


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

sequence_prefix = fields.Char(
string="Sequence Prefix", related="sequence_id.prefix"
)

refund_sequence_prefix = fields.Char(
string="Refund Sequence Prefix", related="refund_sequence_id.prefix"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
6 changes: 6 additions & 0 deletions fermente_account_move_name_sequence/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Customize OCA / account-financial-tools / ``account_move_name_sequence`` module.

* Display in the journal tree view, the prefix of the related sequences.

* when creating sequence from journal form view, set ``range_y`` instead of ``range_year``
by default.
50 changes: 50 additions & 0 deletions fermente_account_move_name_sequence/views/view_account_journal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2025 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="view_account_journal_tree" model="ir.ui.view">
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_tree"/>
<field name="arch" type="xml">
<field name="code" position="after">
<field name="sequence_prefix" optional="show"/>
<field name="refund_sequence_prefix" optional="show"/>
</field>
</field>
</record>

<record id="view_account_journal_form" model="ir.ui.view">
<field name="model">account.journal</field>
<field name="inherit_id" ref="account_move_name_sequence.view_account_journal_form"/>
<field name="arch" type="xml">

<field name="sequence_id" position="attributes">
<attribute name="context">{
'default_name': name,
'default_company_id': company_id,
'default_implementation': 'no_gap',
'default_padding': 4,
'default_use_date_range': True,
'default_prefix': (code or 'UNKNOWN') + '/%%(range_y)s/'
}</attribute>
</field>

<field name="refund_sequence_id" position="attributes">
<attribute name="context">{
'default_name': name,
'default_company_id': company_id,
'default_implementation': 'no_gap',
'default_padding': 4,
'default_use_date_range': True,
'default_prefix': (code or 'UNKNOWN') + '/%%(range_y)s/'
}</attribute>
</field>

</field>
</record>

</odoo>
1 change: 1 addition & 0 deletions setup/fermente_account/odoo/addons/fermente_account
6 changes: 6 additions & 0 deletions setup/fermente_account/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
6 changes: 6 additions & 0 deletions setup/fermente_account_invoice_margin/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
6 changes: 6 additions & 0 deletions setup/fermente_account_invoice_triple_discount/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading

0 comments on commit fa8b6fb

Please sign in to comment.