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
=== added directory 'account_fiscal_position_country_sale'
=== added file 'account_fiscal_position_country_sale/__init__.py'
--- account_fiscal_position_country_sale/__init__.py 1970-01-01 00:00:00 +0000
+++ account_fiscal_position_country_sale/__init__.py 2013-08-28 16:22:51 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
5# Copyright (C) 2011-2013 Agile Business Group sagl
6# (<http://www.agilebg.com>)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23import sale
024
=== added file 'account_fiscal_position_country_sale/__openerp__.py'
--- account_fiscal_position_country_sale/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_fiscal_position_country_sale/__openerp__.py 2013-08-28 16:22:51 +0000
@@ -0,0 +1,44 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
5# Copyright (C) 2011-2013 Agile Business Group sagl
6# (<http://www.agilebg.com>)
7# @author Leonardo Pistone <leonardo.pistone@agilebg.com>
8# Ported to OpenERP 7.0 by Alex Comba <alex.comba@agilebg.com>
9#
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as published
12# by the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Affero General Public License for more details.
19#
20# You should have received a copy of the GNU Affero General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22#
23##############################################################################
24
25{
26 'name': 'Fiscal Position by country, sales',
27 'version': '0.3',
28 'category': 'Generic Modules/Accounting',
29 'description': """
30A rule to select automatically the fiscal position in a sale order
31This module extends the account_fiscal_position_country_sale to sale orders.
32The modules are kept separate to reduce dependencies
33 """,
34 'author': 'Agile Business Group',
35 'website': 'http://www.agilebg.com',
36 'license': 'AGPL-3',
37 'depends': [
38 'account_fiscal_position_country',
39 'sale'
40 ],
41 'data': [],
42 'active': False,
43 'installable': True,
44}
045
=== added file 'account_fiscal_position_country_sale/sale.py'
--- account_fiscal_position_country_sale/sale.py 1970-01-01 00:00:00 +0000
+++ account_fiscal_position_country_sale/sale.py 2013-08-28 16:22:51 +0000
@@ -0,0 +1,43 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
5# Copyright (C) 2011-2013 Agile Business Group sagl
6# (<http://www.agilebg.com>)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from openerp.osv import fields, orm
24
25
26class sale_order(orm.Model):
27 _inherit = "sale.order"
28
29 def onchange_partner_id(self, cr, uid, ids, partner_id, context=None):
30 result = super(sale_order, self).onchange_partner_id(
31 cr, uid, ids, partner_id, context=context)
32 if not result['value']['fiscal_position']:
33 if partner_id:
34 partner = self.pool.get('res.partner').browse(
35 cr, uid, partner_id)
36 result['value']['fiscal_position'] = (
37 partner.country_id
38 and partner.country_id.property_account_position
39 and partner.country_id.property_account_position.id
40 or False
41 )
42
43 return result

Subscribers

People subscribed via source and target branches