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

[ADD] added new module #1

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions s6r_sale_invoiced_forced_qty/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
S6R Sale Order Invoiced Forced Qty
===============

This module allows to force the invoiced quantity on Sale Orders,
it is useful in customer data import scenarios where the historical invoices are not imported.


## Usage


## Authors

* Scalizer

## Contributors

* Colin Chibois ([Github](https://github.com/superColson))

## Maintainers

This module is maintained by [Scalizer](https://www.scalizer.fr).

![Scalizer](static/description/logo.png)
4 changes: 4 additions & 0 deletions s6r_sale_invoiced_forced_qty/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Scalizer (<https://www.scalizer.fr>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0.html).

from . import models
33 changes: 33 additions & 0 deletions s6r_sale_invoiced_forced_qty/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2024 Scalizer (<https://www.scalizer.fr>)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
'name': 'S6R Sale Order Invoiced Forced Qty',
'version': '17.0.1.0.1',
'author': 'Scalizer',
'website': 'https://www.scalizer.fr',
'summary': "This module allows to force the invoiced quantity on Sale Orders",
'sequence': 0,
'license': 'LGPL-3',
'depends': [
'sale',
],
'category': 'Generic Modules/Scalizer',
'complexity': 'easy',
'description': '''
This module allows to force the invoiced quantity on Sale Orders,
it is useful in customer data import scenarios where the historical invoices are not imported.
''',
'qweb': [
],
'demo': [
],
'images': [
],
'data': [
'views/sale_order_form_inherit.xml',
'security/ir.model.access.csv',
],
'auto_install': False,
'installable': True,
'application': False,
}
38 changes: 38 additions & 0 deletions s6r_sale_invoiced_forced_qty/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * s6r_sale_invoiced_forced_qty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-09 16:11+0000\n"
"PO-Revision-Date: 2024-12-09 16:11+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: s6r_sale_invoiced_forced_qty
#: model:ir.model.fields,field_description:s6r_sale_invoiced_forced_qty.field_sale_order_line__qty_invoiced_forced
msgid "Forced Invoiced Quantity"
msgstr "Quantité facturée (forcée)"

#. module: s6r_sale_invoiced_forced_qty
#: model_terms:ir.ui.view,arch_db:s6r_sale_invoiced_forced_qty.sale_order_form_inherit
msgid "Invoiced Forced"
msgstr "Qté facturée (forcée)"

#. module: s6r_sale_invoiced_forced_qty
#: model:ir.model.fields,help:s6r_sale_invoiced_forced_qty.field_sale_order_line__qty_invoiced_forced
msgid ""
"Qty already invoiced but not related to existing invoices in Odoo (for "
"history data import purposes)"
msgstr "Quantité déjà facturée mais non liée à des factures existantes dans Odoo (pour les import de données client historique)."

#. module: s6r_sale_invoiced_forced_qty
#: model:ir.model,name:s6r_sale_invoiced_forced_qty.model_sale_order_line
msgid "Sales Order Line"
msgstr "Ligne de commande"
3 changes: 3 additions & 0 deletions s6r_sale_invoiced_forced_qty/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2024 Scalizer (<https://www.scalizer.fr>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0.html).
from . import sale_order_line
19 changes: 19 additions & 0 deletions s6r_sale_invoiced_forced_qty/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from odoo import models, fields, api


class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'

qty_invoiced_forced = fields.Float(
string="Forced Invoiced Quantity",
help= "Qty already invoiced but not related to existing invoices in Odoo (for history data import purposes)",
digits='Product Unit of Measure',
groups= "base.group_system")


@api.depends('invoice_lines.move_id.state', 'invoice_lines.quantity', 'qty_invoiced_forced')
def _compute_qty_invoiced(self):
super()._compute_qty_invoiced()
for line in self:
line.qty_invoiced += line.qty_invoiced_forced
return
1 change: 1 addition & 0 deletions s6r_sale_invoiced_forced_qty/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions s6r_sale_invoiced_forced_qty/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<section class="oe_container ">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="color:#A24689;">Scalizer Addon Template</h2>
<h3 class="oe_slogan">s6r_addon_template</h3>
<div class="oe_slogan">
<p class="oe_mt32 oe_mb32 text-center">
This module adds ...
</p>
</div>
</div>
</section>


<section class="oe_container">
<div class="oe_row oe_spaced" style="display: flex;align-items: center;">
<div class="col-md-6 text-center">
<img src="logo.png"/>
</div>
<div class="col-md-6 text-center">
<a class="btn btn-primary btn-lg mt8 align-middle" href="https://www.scalizer.fr/contact"><i class="fa fa-envelope-o"></i> Contact US </a>
</div>
</div>
</section>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions s6r_sale_invoiced_forced_qty/views/sale_order_form_inherit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="sale_order_form_inherit" model="ir.ui.view">
<field name="name">sale.order.form.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree/field[@name='qty_invoiced']" position="before">
<field name="qty_invoiced_forced"
decoration-info="(not display_type and invoice_status == 'to invoice')"
decoration-bf="(not display_type and invoice_status == 'to invoice')"
string="Invoiced Forced"
column_invisible="parent.state != 'sale'"
optional="hide"/>
</xpath>
</field>
</record>
</odoo>
Loading