Commit 4ed8e89 Jacob Hicks
committed
1 parent de21fa4 commit 4ed8e89 Copy full SHA for 4ed8e89
File tree 6 files changed +68
-29
lines changed
6 files changed +68
-29
lines changed Original file line number Diff line number Diff line change
1
+ .. image :: https://img.shields.io/badge/licence-AGPL--3-blue.svg
2
+ :alt: License: AGPL-3
3
+
4
+ Sale Pricelist Discount
5
+ =======================
6
+
7
+ This module allows specifying a default percentage discount to apply
8
+ to sale order lines. This ensures the pricelist discount is visible
9
+ on quotations and sale orders.
10
+
11
+ Installation
12
+ ============
13
+
14
+ Nothing special is needed to install this module.
15
+
16
+ Configuration
17
+ =============
18
+
19
+ Pricelist configuration:
20
+
21
+ * Add discount percentage value to pricelist items for which the
22
+ discount should be visible on sale order lines
23
+
24
+ Usage
25
+ =====
26
+
27
+ * Select pricelist on sale order line
28
+
29
+ * The discount defined on pricelist item will be populated as
30
+ the sale order line discount percentage
31
+
32
+ Known issues / Roadmap
33
+ ======================
34
+
35
+ * Incompatible with product_visible_discount
36
+
37
+ Credits
38
+ =======
39
+
40
+ Contributors
41
+ ------------
42
+
43
+ * Jacob Hicks <jacob.hicks@credativ.co.uk>
44
+
45
+ Maintainer
46
+ ----------
47
+
48
+ .. image :: http://odoo-community.org/logo.png
49
+ :alt: Odoo Community Association
50
+ :target: http://odoo-community.org
51
+
52
+ This module is maintained by the OCA.
53
+
54
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
55
+ mission is to support the collaborative development of Odoo features and
56
+ promote its widespread use.
57
+
58
+ To contribute to this module, please visit http://odoo-community.org.
Original file line number Diff line number Diff line change 2
2
#
3
3
# OpenERP, Open Source Management Solution
4
4
# Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>).
5
- # All Rights Reserved
6
5
#
7
6
# This program is free software: you can redistribute it and/or modify
8
7
# it under the terms of the GNU Affero General Public License as
20
19
##############################################################################
21
20
22
21
from . import model
23
-
24
- # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Original file line number Diff line number Diff line change 2
2
#
3
3
# OpenERP, Open Source Management Solution
4
4
# Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>).
5
- # All Rights Reserved
6
5
#
7
6
# This program is free software: you can redistribute it and/or modify
8
7
# it under the terms of the GNU Affero General Public License as
28
27
to sale order lines. This ensures the pricelist discount is visible
29
28
on quotations and sale orders.
30
29
""" ,
31
- 'author' : 'credativ' ,
30
+ 'author' : 'credativ, Odoo Community Association (OCA) ' ,
32
31
'website' : 'http://www.credativ.co.uk' ,
33
32
'depends' : [
34
33
'base' ,
35
34
'sale' ,
36
35
'product' ,
37
36
],
38
- 'update_xml ' : [
37
+ 'data ' : [
39
38
'view/pricelist_view.xml'
40
39
],
41
40
'auto_install' : False ,
42
41
'installable' : True ,
43
42
}
44
- # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Original file line number Diff line number Diff line change 2
2
#
3
3
# OpenERP, Open Source Management Solution
4
4
# Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>).
5
- # All Rights Reserved
6
5
#
7
6
# This program is free software: you can redistribute it and/or modify
8
7
# it under the terms of the GNU Affero General Public License as
21
20
22
21
from . import pricelist
23
22
from . import sale
24
-
25
- # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Original file line number Diff line number Diff line change 3
3
#
4
4
# OpenERP, Open Source Management Solution
5
5
# Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>).
6
- # All Rights Reserved
7
6
#
8
7
# This program is free software: you can redistribute it and/or modify
9
8
# it under the terms of the GNU Affero General Public License as
20
19
#
21
20
##############################################################################
22
21
23
- from openerp . osv import fields , osv
22
+ from openerp import fields , models
24
23
import openerp .addons .decimal_precision as dp
25
24
26
25
27
- class product_pricelist_item ( osv . osv ):
26
+ class ProductPricelistItem ( models . Model ):
28
27
_inherit = 'product.pricelist.item'
29
28
30
- _columns = {
31
- 'discount' : fields .float (
32
- 'Discount (%)' ,
33
- digits_compute = dp .get_precision ('Discount' ),
34
- help = "Default discount applied on a sale order line." ,
35
- ),
36
- }
37
-
38
- _defaults = {
39
- 'discount' : 0.0 ,
40
- }
41
-
42
- # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
29
+ discount = fields .Float (
30
+ 'Discount (%)' ,
31
+ digits_compute = dp .get_precision ('Discount' ),
32
+ help = "Default discount applied on a sale order line." ,
33
+ default = 0.0 ,
34
+ )
Original file line number Diff line number Diff line change 3
3
#
4
4
# OpenERP, Open Source Management Solution
5
5
# Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>).
6
- # All Rights Reserved
7
6
#
8
7
# This program is free software: you can redistribute it and/or modify
9
8
# it under the terms of the GNU Affero General Public License as
@@ -53,5 +52,3 @@ def product_id_change(
53
52
cr , uid , [rule_id ], ['discount' ])[0 ]['discount' ] or 0.00
54
53
55
54
return res
56
-
57
- # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
You can’t perform that action at this time.
0 commit comments