Skip to content

Commit 3f19eda

Browse files
committed
[ADD] new module to force received qty on PO lines
1 parent 917f0fa commit 3f19eda

File tree

11 files changed

+122
-0
lines changed

11 files changed

+122
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
S6R Purchase Order Invoiced Forced Qty
2+
===============
3+
4+
This module allows to force the invoiced quantity on Purchase Orders,
5+
it is useful in customer data import scenarios where the historical supplier invoices are not imported
6+
7+
8+
## Usage
9+
10+
11+
## Authors
12+
13+
* Scalizer
14+
15+
## Contributors
16+
17+
* Colin Chibois ([Github](https://github.com/superColson))
18+
19+
## Maintainers
20+
21+
This module is maintained by [Scalizer](https://www.scalizer.fr).
22+
23+
![Scalizer](static/description/logo.png)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2025 Scalizer (<https://www.scalizer.fr>)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0.html).
3+
4+
from . import models
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2025 Scalizer (<https://www.scalizer.fr>)
2+
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
3+
{
4+
'name': 'S6R Purchase Order Line Received Forced Qty',
5+
'version': '17.0.1.0.1',
6+
'author': 'Scalizer',
7+
'website': 'https://www.scalizer.fr',
8+
'summary': "This module allows to force the received quantity on Purchase Order Lines",
9+
'sequence': 0,
10+
'license': 'LGPL-3',
11+
'depends': [
12+
'purchase_stock',
13+
],
14+
'category': 'Generic Modules/Scalizer',
15+
'complexity': 'easy',
16+
'description': '''
17+
This module allows to force the received quantity on Purchase Order Lines,
18+
it is useful in customer data import scenarios where the historical stock moves are not imported.
19+
''',
20+
'qweb': [
21+
],
22+
'demo': [
23+
],
24+
'images': [
25+
],
26+
'data': [
27+
'views/purchase_order_views.xml',
28+
'security/ir.model.access.csv',
29+
],
30+
'auto_install': False,
31+
'installable': True,
32+
'application': False,
33+
}

s6r_purchase_received_forced_qty/i18n/fr.po

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright 2025 Scalizer (<https://www.scalizer.fr>)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0.html).
3+
from . import purchase_order_line
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from odoo import models, fields, api
2+
3+
4+
class PurchaseOrderLine(models.Model):
5+
_inherit = 'purchase.order.line'
6+
7+
qty_received_forced = fields.Float(
8+
string="Forced Received Qty",
9+
help= "Qty already received but not related to existing stock move in Odoo (for history data import purposes)",
10+
digits='Product Unit of Measure',
11+
copy=False,
12+
)
13+
14+
@api.depends('qty_received_forced')
15+
def _compute_qty_received(self):
16+
super()._compute_qty_received()
17+
for line in self:
18+
line.qty_received += line.qty_received_forced
19+
return
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<section class="oe_container ">
2+
<div class="oe_row oe_spaced">
3+
<h2 class="oe_slogan" style="color:#A24689;">Scalizer Addon Template</h2>
4+
<h3 class="oe_slogan">s6r_addon_template</h3>
5+
<div class="oe_slogan">
6+
<p class="oe_mt32 oe_mb32 text-center">
7+
This module adds ...
8+
</p>
9+
</div>
10+
</div>
11+
</section>
12+
13+
14+
<section class="oe_container">
15+
<div class="oe_row oe_spaced" style="display: flex;align-items: center;">
16+
<div class="col-md-6 text-center">
17+
<img src="logo.png"/>
18+
</div>
19+
<div class="col-md-6 text-center">
20+
<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>
21+
</div>
22+
</div>
23+
</section>
Loading
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<record id="purchase_order_form_inherit_s6r" model="ir.ui.view">
4+
<field name="name">purchase.order.form.inherit.s6r</field>
5+
<field name="model">purchase.order</field>
6+
<field name="inherit_id" ref="purchase.purchase_order_form"/>
7+
<field name="arch" type="xml">
8+
<xpath expr="//field[@name='order_line']/tree/field[@name='qty_invoiced']" position="before">
9+
<field name="qty_received_forced"
10+
string="Received Forced"
11+
optional="hide"
12+
groups="base.group_system"/>
13+
</xpath>
14+
</field>
15+
</record>
16+
</odoo>

0 commit comments

Comments
 (0)