Merge lp:~scigghia/andreacometa-addons/adding_multiple_ddt_7 into lp:andreacometa-addons/7.0

Proposed by Andrea Cometa
Status: Needs review
Proposed branch: lp:~scigghia/andreacometa-addons/adding_multiple_ddt_7
Merge into: lp:andreacometa-addons/7.0
Diff against target: 203 lines (+171/-0)
6 files modified
l10n_it_multiple_ddt/__init__.py (+24/-0)
l10n_it_multiple_ddt/__openerp__.py (+39/-0)
l10n_it_multiple_ddt/sequence.xml (+10/-0)
l10n_it_multiple_ddt/wizard/__init__.py (+24/-0)
l10n_it_multiple_ddt/wizard/assign_ddt.py (+57/-0)
l10n_it_multiple_ddt/wizard/assign_ddt.xml (+17/-0)
To merge this branch: bzr merge lp:~scigghia/andreacometa-addons/adding_multiple_ddt_7
Reviewer Review Type Date Requested Status
Briganti Pending
Review via email: mp+199894@code.launchpad.net

Description of the change

Aggiunto il modulo l10n_it_multiple_ddt, da la possibilità di scegliere una sequence differente durante l'emissione del DDT

To post a comment you must log in.

Unmerged revisions

18. By Andrea Cometa

l10n_it_multiple_ddt add prima release

17. By Andrea Cometa

[fix] test ok on 7.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'l10n_it_multiple_ddt'
2=== added file 'l10n_it_multiple_ddt/__init__.py'
3--- l10n_it_multiple_ddt/__init__.py 1970-01-01 00:00:00 +0000
4+++ l10n_it_multiple_ddt/__init__.py 2013-12-21 11:26:13 +0000
5@@ -0,0 +1,24 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (c) 2012 Andrea Cometa All Rights Reserved.
11+# www.andreacometa.it
12+# openerp@andreacometa.it
13+#
14+# This program is free software: you can redistribute it and/or modify
15+# it under the terms of the GNU Affero General Public License as published
16+# by the Free Software Foundation, either version 3 of the License, or
17+# (at your option) any later version.
18+#
19+# This program is distributed in the hope that it will be useful,
20+# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+# GNU Affero General Public License for more details.
23+#
24+# You should have received a copy of the GNU Affero General Public License
25+# along with this program. If not, see <http://www.gnu.org/licenses/>.
26+#
27+##############################################################################
28+
29+import wizard
30
31=== added file 'l10n_it_multiple_ddt/__openerp__.py'
32--- l10n_it_multiple_ddt/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ l10n_it_multiple_ddt/__openerp__.py 2013-12-21 11:26:13 +0000
34@@ -0,0 +1,39 @@
35+# -*- encoding: utf-8 -*-
36+##############################################################################
37+#
38+# OpenERP, Open Source Management Solution
39+# Copyright (c) 2012 Andrea Cometa All Rights Reserved.
40+# www.andreacometa.it
41+# openerp@andreacometa.it
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': "l10n_it_multiple_ddt",
60+ 'version': '0.1',
61+ 'category': 'Localization',
62+ 'description': """Adds different sequences for DDT""",
63+ 'author': 'Andrea Cometa',
64+ 'website': 'www.andreacometa.it',
65+ 'license': 'AGPL-3',
66+ "depends": ['l10n_it_sale'],
67+ "data": [
68+ 'wizard/assign_ddt.xml',
69+ 'sequence.xml'],
70+ "demo": [],
71+ "active": False,
72+ "installable": True
73+}
74
75=== added directory 'l10n_it_multiple_ddt/l18n'
76=== added file 'l10n_it_multiple_ddt/sequence.xml'
77--- l10n_it_multiple_ddt/sequence.xml 1970-01-01 00:00:00 +0000
78+++ l10n_it_multiple_ddt/sequence.xml 2013-12-21 11:26:13 +0000
79@@ -0,0 +1,10 @@
80+<?xml version="1.0" encoding="utf-8"?>
81+<openerp>
82+ <data>
83+ <record id="seq_ddt_b" model="ir.sequence">
84+ <field name="name">DDTB</field>
85+ <field name="code">stock.ddt</field>
86+ <field name="prefix">DDT-B/</field>
87+ </record>
88+ </data>
89+</openerp>
90
91=== added directory 'l10n_it_multiple_ddt/wizard'
92=== added file 'l10n_it_multiple_ddt/wizard/__init__.py'
93--- l10n_it_multiple_ddt/wizard/__init__.py 1970-01-01 00:00:00 +0000
94+++ l10n_it_multiple_ddt/wizard/__init__.py 2013-12-21 11:26:13 +0000
95@@ -0,0 +1,24 @@
96+# -*- coding: utf-8 -*-
97+##############################################################################
98+#
99+# OpenERP, Open Source Management Solution
100+# Copyright (c) 2012 Andrea Cometa All Rights Reserved.
101+# www.andreacometa.it
102+# openerp@andreacometa.it
103+#
104+# This program is free software: you can redistribute it and/or modify
105+# it under the terms of the GNU Affero General Public License as published
106+# by the Free Software Foundation, either version 3 of the License, or
107+# (at your option) any later version.
108+#
109+# This program is distributed in the hope that it will be useful,
110+# but WITHOUT ANY WARRANTY; without even the implied warranty of
111+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
112+# GNU Affero General Public License for more details.
113+#
114+# You should have received a copy of the GNU Affero General Public License
115+# along with this program. If not, see <http://www.gnu.org/licenses/>.
116+#
117+##############################################################################
118+
119+import assign_ddt
120
121=== added file 'l10n_it_multiple_ddt/wizard/assign_ddt.py'
122--- l10n_it_multiple_ddt/wizard/assign_ddt.py 1970-01-01 00:00:00 +0000
123+++ l10n_it_multiple_ddt/wizard/assign_ddt.py 2013-12-21 11:26:13 +0000
124@@ -0,0 +1,57 @@
125+# -*- coding: utf-8 -*-
126+##############################################################################
127+#
128+# OpenERP, Open Source Management Solution
129+# Copyright (c) 2012 Andrea Cometa All Rights Reserved.
130+# www.andreacometa.it
131+# openerp@andreacometa.it
132+#
133+# This program is free software: you can redistribute it and/or modify
134+# it under the terms of the GNU Affero General Public License as published
135+# by the Free Software Foundation, either version 3 of the License, or
136+# (at your option) any later version.
137+#
138+# This program is distributed in the hope that it will be useful,
139+# but WITHOUT ANY WARRANTY; without even the implied warranty of
140+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
141+# GNU Affero General Public License for more details.
142+#
143+# You should have received a copy of the GNU Affero General Public License
144+# along with this program. If not, see <http://www.gnu.org/licenses/>.
145+#
146+##############################################################################
147+
148+from openerp.osv import orm, fields
149+from tools.translate import _
150+import time
151+
152+
153+class wizard_assign_ddt(orm.TransientModel):
154+ _inherit = "wizard.assign.ddt"
155+
156+ _columns = {
157+ 'ddt_sequence': fields.many2one(
158+ 'ir.sequence',
159+ 'DDT Sequences',
160+ required=True,
161+ domain="[('code','=','stock.ddt')]")
162+ }
163+
164+ def assign_ddt(self, cr, uid, ids, context=None):
165+ picking_obj = self.pool.get('stock.picking.out')
166+ wizard_obj = self.browse(cr, uid, ids)
167+ for wizard in wizard_obj:
168+ for picking in picking_obj.browse(cr, uid,
169+ context.get('active_ids', []),
170+ context=context):
171+ if picking.ddt_number:
172+ raise orm.except_orm(_('Error'),
173+ _('DTT number already assigned'))
174+ picking.write({
175+ 'ddt_number': self.pool.get('ir.sequence').next_by_id(
176+ cr, uid, wizard.ddt_sequence.id),
177+ 'ddt_date': time.strftime('%Y-%m-%d'),
178+ })
179+ return {
180+ 'type': 'ir.actions.act_window_close',
181+ }
182
183=== added file 'l10n_it_multiple_ddt/wizard/assign_ddt.xml'
184--- l10n_it_multiple_ddt/wizard/assign_ddt.xml 1970-01-01 00:00:00 +0000
185+++ l10n_it_multiple_ddt/wizard/assign_ddt.xml 2013-12-21 11:26:13 +0000
186@@ -0,0 +1,17 @@
187+<?xml version="1.0" encoding="utf-8"?>
188+<openerp>
189+ <data>
190+
191+ <record id="multiple_wizard_assign_ddt" model="ir.ui.view">
192+ <field name="name">Assign DDT</field>
193+ <field name="model">wizard.assign.ddt</field>
194+ <field name="inherit_id" ref="l10n_it_sale.wizard_assign_ddt"/>
195+ <field name="arch" type="xml">
196+ <label string="This will assign the DDT number" position="after">
197+ <field name="ddt_sequence" colspan="4" />
198+ </label>
199+ </field>
200+ </record>
201+
202+ </data>
203+</openerp>

Subscribers

People subscribed via source and target branches