Skip to content

Commit 374df37

Browse files
committed
improve style
1 parent dcf1fc3 commit 374df37

File tree

8 files changed

+488
-12
lines changed

8 files changed

+488
-12
lines changed

stock_serial_number/README.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
===================
2+
Stock Serial Number
3+
===================
4+
5+
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!! This file is generated by oca-gen-addon-readme !!
7+
!! changes will be overwritten. !!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
10+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
11+
:target: https://odoo-community.org/page/development-status
12+
:alt: Beta
13+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
14+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
15+
:alt: License: LGPL-3
16+
.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Fpci--custom-lightgray.png?logo=github
17+
:target: https://github.com/qrtl/pci-custom/tree/10.0/stock_serial_number
18+
:alt: qrtl/pci-custom
19+
20+
|badge1| |badge2| |badge3|
21+
22+
This module does the following:
23+
24+
* Adds models necessary to configure guitar products.
25+
26+
**Table of contents**
27+
28+
.. contents::
29+
:local:
30+
31+
Bug Tracker
32+
===========
33+
34+
Bugs are tracked on `GitHub Issues <https://github.com/qrtl/pci-custom/issues>`_.
35+
In case of trouble, please check there if your issue has already been reported.
36+
If you spotted it first, help us smashing it by providing a detailed and welcomed
37+
`feedback <https://github.com/qrtl/pci-custom/issues/new?body=module:%20stock_serial_number%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
38+
39+
Do not contact contributors directly about support or help with technical issues.
40+
41+
Credits
42+
=======
43+
44+
Authors
45+
~~~~~~~
46+
47+
* Quartile Limited
48+
49+
Maintainers
50+
~~~~~~~~~~~
51+
52+
This module is part of the `qrtl/pci-custom <https://github.com/qrtl/pci-custom/tree/10.0/stock_serial_number>`_ project on GitHub.
53+
54+
You are welcome to contribute.

stock_serial_number/__manifest__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
'license': "LGPL-3",
1111
'description': "",
1212
'depends': [
13-
'sale',
14-
'stock',
15-
'sale_order_lot_selection',
16-
'account_invoice_line_view',
13+
"sale_stock",
14+
"sale_order_lot_selection",
15+
"account_invoice_line_view",
1716
],
1817
'data': [
1918
'security/ir.model.access.csv',

stock_serial_number/models/sale_order.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
# Copyright 2017-2023 Quartile Limited
33
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
44

5-
from odoo import _, models, api
5+
from odoo import _, api, models
66
from odoo.exceptions import UserError
77

88

99
class SaleOrder(models.Model):
1010
_inherit = "sale.order"
1111

12-
1312
@api.multi
1413
def action_confirm(self):
1514
for order in self:

stock_serial_number/models/sale_order_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2017 Quartile Limited
33
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
44

5-
from odoo import models, fields, api
5+
from odoo import api, models
66

77

88
class SaleOrderLine(models.Model):

stock_serial_number/models/stock_body.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2017 Quartile Limited
33
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
44

5-
from odoo import models, fields
5+
from odoo import fields, models
66

77

88
class StockBody(models.Model):

stock_serial_number/models/stock_move.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
from openerp.osv import osv, fields
4-
import openerp.addons.decimal_precision as dp
3+
from openerp.osv import osv
54
from openerp.tools.translate import _
65

76

@@ -17,7 +16,19 @@ def action_done(self, cr, uid, ids, context=None):
1716
raise osv.except_osv(_('Error!'), _('Quantity of stock move should be 1 for product %s (enforce quantity 1).')
1817
% move.product_id.name)
1918
if move.sale_line_id and not move.sale_line_id.serial_id and move.prodlot_id:
20-
self.pool.get('sale.order.line').write(cr, uid, [move.sale_line_id.id], {'serial_id': move.prodlot_id.id}, context)
19+
self.pool.get('sale.order.line').write(
20+
cr,
21+
uid,
22+
[move.sale_line_id.id],
23+
{'serial_id': move.prodlot_id.id},
24+
context,
25+
)
2126
invoice_line_ids = [line.id for line in move.sale_line_id.invoice_lines]
22-
self.pool.get('account.invoice.line').write(cr, uid, invoice_line_ids, {'serial_id':move.prodlot_id.id}, context)
27+
self.pool.get('account.invoice.line').write(
28+
cr,
29+
uid,
30+
invoice_line_ids,
31+
{'serial_id': move.prodlot_id.id},
32+
context,
33+
)
2334
return res
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This module does the following:
2+
3+
* Adds models necessary to configure guitar products.

0 commit comments

Comments
 (0)