Merge lp:~agilebg/sale-wkfl/adding_account_fiscal_position_country_sale_7 into lp:~sale-core-editors/sale-wkfl/7.0

Proposed by Alex Comba - Agile BG
Status: Rejected
Rejected by: Guewen Baconnier @ Camptocamp
Proposed branch: lp:~agilebg/sale-wkfl/adding_account_fiscal_position_country_sale_7
Merge into: lp:~sale-core-editors/sale-wkfl/7.0
Diff against target: 125 lines (+110/-0)
3 files modified
account_fiscal_position_country_sale/__init__.py (+23/-0)
account_fiscal_position_country_sale/__openerp__.py (+44/-0)
account_fiscal_position_country_sale/sale.py (+43/-0)
To merge this branch: bzr merge lp:~agilebg/sale-wkfl/adding_account_fiscal_position_country_sale_7
Reviewer Review Type Date Requested Status
Lorenzo Battistini (community) Disapprove
Joël Grand-Guillaume @ camptocamp Needs Information
Guewen Baconnier @ Camptocamp Needs Information
Review via email: mp+182638@code.launchpad.net

Description of the change

This branch adds the account_fiscal_position_country_sale porting to 7.0

The module extends the account_fiscal_position_country_sale to sale orders.

To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :

account_fiscal_position_country_sale/sale_view.xml: is it still needed?

line 114: too long

review: Needs Fixing
22. By Alex Comba - Agile BG

[REM] unnecessary sale_view.xml

Revision history for this message
Alex Comba - Agile BG (tafaru) wrote :

Lorenzo, you were right: sale_view.xml is unnecessary, thanks!

Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :
review: Needs Information
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

+1 for having an explanation on this comment "Seems redundant with account_fiscal_position_rule in the https://code.launchpad.net/openerp-fiscal-rules project.
Do you have a reason for not reusing it?"

review: Needs Information
Revision history for this message
Lorenzo Battistini (elbati) wrote :
review: Disapprove

Unmerged revisions

22. By Alex Comba - Agile BG

[REM] unnecessary sale_view.xml

21. By Alex Comba - Agile BG

[FIX] method onchange_partner_id_fiscal_position

20. By Alex Comba - Agile BG

[REF] ported module account_fiscal_position_country_sale to ver. 7.0

19. By Alex Comba - Agile BG

[ADD] module account_fiscal_position_country_sale ver. 6.1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_fiscal_position_country_sale'
2=== added file 'account_fiscal_position_country_sale/__init__.py'
3--- account_fiscal_position_country_sale/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_fiscal_position_country_sale/__init__.py 2013-08-28 16:22:51 +0000
5@@ -0,0 +1,23 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
10+# Copyright (C) 2011-2013 Agile Business Group sagl
11+# (<http://www.agilebg.com>)
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as published
15+# by the Free Software Foundation, either version 3 of the License, or
16+# (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+
28+import sale
29
30=== added file 'account_fiscal_position_country_sale/__openerp__.py'
31--- account_fiscal_position_country_sale/__openerp__.py 1970-01-01 00:00:00 +0000
32+++ account_fiscal_position_country_sale/__openerp__.py 2013-08-28 16:22:51 +0000
33@@ -0,0 +1,44 @@
34+# -*- coding: utf-8 -*-
35+##############################################################################
36+#
37+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
38+# Copyright (C) 2011-2013 Agile Business Group sagl
39+# (<http://www.agilebg.com>)
40+# @author Leonardo Pistone <leonardo.pistone@agilebg.com>
41+# Ported to OpenERP 7.0 by Alex Comba <alex.comba@agilebg.com>
42+#
43+# This program is free software: you can redistribute it and/or modify
44+# it under the terms of the GNU Affero General Public License as published
45+# by the Free Software Foundation, either version 3 of the License, or
46+# (at your option) any later version.
47+#
48+# This program is distributed in the hope that it will be useful,
49+# but WITHOUT ANY WARRANTY; without even the implied warranty of
50+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51+# GNU Affero General Public License for more details.
52+#
53+# You should have received a copy of the GNU Affero General Public License
54+# along with this program. If not, see <http://www.gnu.org/licenses/>.
55+#
56+##############################################################################
57+
58+{
59+ 'name': 'Fiscal Position by country, sales',
60+ 'version': '0.3',
61+ 'category': 'Generic Modules/Accounting',
62+ 'description': """
63+A rule to select automatically the fiscal position in a sale order
64+This module extends the account_fiscal_position_country_sale to sale orders.
65+The modules are kept separate to reduce dependencies
66+ """,
67+ 'author': 'Agile Business Group',
68+ 'website': 'http://www.agilebg.com',
69+ 'license': 'AGPL-3',
70+ 'depends': [
71+ 'account_fiscal_position_country',
72+ 'sale'
73+ ],
74+ 'data': [],
75+ 'active': False,
76+ 'installable': True,
77+}
78
79=== added file 'account_fiscal_position_country_sale/sale.py'
80--- account_fiscal_position_country_sale/sale.py 1970-01-01 00:00:00 +0000
81+++ account_fiscal_position_country_sale/sale.py 2013-08-28 16:22:51 +0000
82@@ -0,0 +1,43 @@
83+# -*- coding: utf-8 -*-
84+##############################################################################
85+#
86+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
87+# Copyright (C) 2011-2013 Agile Business Group sagl
88+# (<http://www.agilebg.com>)
89+#
90+# This program is free software: you can redistribute it and/or modify
91+# it under the terms of the GNU Affero General Public License as published
92+# by the Free Software Foundation, either version 3 of the License, or
93+# (at your option) any later version.
94+#
95+# This program is distributed in the hope that it will be useful,
96+# but WITHOUT ANY WARRANTY; without even the implied warranty of
97+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98+# GNU Affero General Public License for more details.
99+#
100+# You should have received a copy of the GNU Affero General Public License
101+# along with this program. If not, see <http://www.gnu.org/licenses/>.
102+#
103+##############################################################################
104+
105+from openerp.osv import fields, orm
106+
107+
108+class sale_order(orm.Model):
109+ _inherit = "sale.order"
110+
111+ def onchange_partner_id(self, cr, uid, ids, partner_id, context=None):
112+ result = super(sale_order, self).onchange_partner_id(
113+ cr, uid, ids, partner_id, context=context)
114+ if not result['value']['fiscal_position']:
115+ if partner_id:
116+ partner = self.pool.get('res.partner').browse(
117+ cr, uid, partner_id)
118+ result['value']['fiscal_position'] = (
119+ partner.country_id
120+ and partner.country_id.property_account_position
121+ and partner.country_id.property_account_position.id
122+ or False
123+ )
124+
125+ return result

Subscribers

People subscribed via source and target branches