Merge lp:~miguel-miguel/bias-trunk/addons_equitek into lp:~openbias/bias-trunk/addons_equitek
- addons_equitek
- Merge into addons_equitek
Proposed by
Miguel Miguel
Status: | Merged |
---|---|
Merged at revision: | 48 |
Proposed branch: | lp:~miguel-miguel/bias-trunk/addons_equitek |
Merge into: | lp:~openbias/bias-trunk/addons_equitek |
Diff against target: |
374 lines (+235/-14) 9 files modified
bias_customization/__init__.py (+1/-0) bias_customization/__openerp__.py (+7/-4) bias_customization/account/__init__.py (+3/-3) bias_customization/sale/i18n/es_MX.po (+4/-0) bias_customization/sale/sale.py (+32/-6) bias_customization/sale/sale_view.xml (+24/-1) bias_customization/voucher/__init__.py (+29/-0) bias_customization/voucher/account_voucher.py (+52/-0) bias_customization/voucher/account_voucher_view.xml (+83/-0) |
To merge this branch: | bzr merge lp:~miguel-miguel/bias-trunk/addons_equitek |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenBias | Pending | ||
Review via email: mp+123101@code.launchpad.net |
Commit message
Description of the change
Cambios en ventas. Se agrego cambios en bias_customization para validar Ordenes de Ventas.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added symlink 'bias_analytic_payment_sale' |
2 | === target is u'../bias_trunk/bias_analytic_payment_sale/' |
3 | === modified file 'bias_customization/__init__.py' |
4 | --- bias_customization/__init__.py 2012-03-02 17:17:07 +0000 |
5 | +++ bias_customization/__init__.py 2012-09-06 14:43:22 +0000 |
6 | @@ -22,6 +22,7 @@ |
7 | |
8 | |
9 | #import account |
10 | +import voucher |
11 | #import partners |
12 | #import payment |
13 | import product |
14 | |
15 | === modified file 'bias_customization/__openerp__.py' |
16 | --- bias_customization/__openerp__.py 2012-03-02 17:17:07 +0000 |
17 | +++ bias_customization/__openerp__.py 2012-09-06 14:43:22 +0000 |
18 | @@ -30,15 +30,19 @@ |
19 | "website" : "http://www.bias.com.mx", |
20 | "license" : "AGPL-3", |
21 | 'depends': ['base', |
22 | -## 'account', |
23 | + 'account', |
24 | + 'account_voucher', |
25 | 'product', |
26 | -# 'procurement', |
27 | + 'sale', |
28 | + 'bias_analytic_payment_sale', |
29 | +## 'procurement', |
30 | ## 'purchase', |
31 | - 'sale', |
32 | ## 'base_vat' |
33 | ], |
34 | 'update_xml': [ |
35 | 'account/account_invoice_view.xml', |
36 | +# 'account/account_view.xml', |
37 | + 'voucher/account_voucher_view.xml', |
38 | 'sale/sale_view.xml', |
39 | # 'security/ir.model.access.csv', |
40 | # 'point_of_sale/wizard/pos_borrowing.xml', |
41 | @@ -48,7 +52,6 @@ |
42 | # 'account/account_invoice_view.xml', |
43 | # 'purchase/purchase_order_report.xml', |
44 | # 'procurement/procurement_workflow.xml', |
45 | - 'sale/sale_view.xml' , |
46 | ], |
47 | 'installable': True, |
48 | 'active': False, |
49 | |
50 | === modified file 'bias_customization/account/__init__.py' |
51 | --- bias_customization/account/__init__.py 2011-11-03 03:33:31 +0000 |
52 | +++ bias_customization/account/__init__.py 2012-09-06 14:43:22 +0000 |
53 | @@ -20,10 +20,10 @@ |
54 | # |
55 | ############################################################################## |
56 | |
57 | - |
58 | -import report |
59 | +#import account_move_line |
60 | +#import report |
61 | #import invoice |
62 | -import wizard |
63 | +#import wizard |
64 | |
65 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
66 | |
67 | |
68 | === modified file 'bias_customization/sale/i18n/es_MX.po' |
69 | --- bias_customization/sale/i18n/es_MX.po 2012-02-24 17:14:57 +0000 |
70 | +++ bias_customization/sale/i18n/es_MX.po 2012-09-06 14:43:22 +0000 |
71 | @@ -61,3 +61,7 @@ |
72 | msgid "Print Invoice" |
73 | msgstr "Imprimir factura" |
74 | |
75 | +#. module: sale |
76 | +#: view:sale.order:0 |
77 | +msgid "Untaxed amount" |
78 | +msgstr "Subtotal" |
79 | |
80 | === modified file 'bias_customization/sale/sale.py' |
81 | --- bias_customization/sale/sale.py 2011-12-14 23:26:28 +0000 |
82 | +++ bias_customization/sale/sale.py 2012-09-06 14:43:22 +0000 |
83 | @@ -19,20 +19,21 @@ |
84 | # |
85 | ############################################################################## |
86 | |
87 | -from datetime import datetime, timedelta |
88 | -from dateutil.relativedelta import relativedelta |
89 | import time |
90 | +from datetime import datetime |
91 | +from operator import itemgetter |
92 | |
93 | +import netsvc |
94 | +import pooler |
95 | from osv import fields, osv |
96 | from tools.translate import _ |
97 | import decimal_precision as dp |
98 | -import netsvc |
99 | +import tools |
100 | |
101 | class sale_order(osv.osv): |
102 | _name = "sale.order" |
103 | _inherit = "sale.order" |
104 | |
105 | - |
106 | _columns = { |
107 | 'state': fields.selection([ |
108 | ('draft', 'Quotation'), |
109 | @@ -45,8 +46,9 @@ |
110 | ('done', 'Done'), |
111 | ('cancel', 'Cancelled') |
112 | ], 'Order State', readonly=True, help="Gives the state of the quotation or sales order. \nThe exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True), |
113 | - } |
114 | - |
115 | + 'project_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True, states={'draft': [('readonly', False)], 'waiting_auto': [('readonly', False)]}, help="The analytic account related to a sales order."), |
116 | + |
117 | + } |
118 | |
119 | def action_autorize(self, cr, uid, ids, *args): |
120 | if not len(ids): |
121 | @@ -54,6 +56,30 @@ |
122 | self.write(cr, uid, ids, {'state': 'waiting_auto', }) |
123 | return True |
124 | |
125 | + def order_autorizacion_object(self, cr, uid, ids, context=None): |
126 | + wf_service = netsvc.LocalService("workflow") |
127 | + if context is None: context = {} |
128 | + res = False |
129 | + analytic_obj = self.pool.get('account.analytic.account') |
130 | + for sale in self.browse(cr, uid, ids, context=context): |
131 | + if sale.state == 'waiting_auto': |
132 | + if sale.project_id: |
133 | + pass |
134 | + else: |
135 | + analytic_id = False |
136 | + analytic_ids = analytic_obj.search(cr, uid, [('id', '=', 2)])[0] |
137 | + if analytic_ids: |
138 | + analytic_id = analytic_ids |
139 | + vals = { |
140 | + 'name': sale.name, |
141 | + 'parent_id': analytic_id, |
142 | + 'partner_id': sale.partner_id.id, |
143 | + } |
144 | + res = analytic_obj.create(cr, uid, vals, context=context) |
145 | + self.write(cr, uid, ids, {'project_id': res}) |
146 | + wf_service.trg_validate(uid, 'sale.order', ids[0], 'autorizacion', cr) |
147 | + return res |
148 | + |
149 | sale_order() |
150 | |
151 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
152 | |
153 | === modified file 'bias_customization/sale/sale_view.xml' |
154 | --- bias_customization/sale/sale_view.xml 2012-02-24 17:15:52 +0000 |
155 | +++ bias_customization/sale/sale_view.xml 2012-09-06 14:43:22 +0000 |
156 | @@ -2,6 +2,27 @@ |
157 | <openerp> |
158 | <data> |
159 | |
160 | + <!-- Pagos --> |
161 | + <record model="ir.ui.view" id="view_order_form_inherit_01"> |
162 | + <field name="name">sale.order.form.inherit.01</field> |
163 | + <field name="model">sale.order</field> |
164 | + <field name="type">form</field> |
165 | + <field name="inherit_id" ref="sale.view_order_form"/> |
166 | + <field name="arch" type="xml"> |
167 | + <field name="project_id" position="replace"> |
168 | + <field name="project_id" |
169 | + context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}" |
170 | + groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" /> <!-- attrs="{'required':[('state','=', 'waiting_auto')]}" --> |
171 | + </field> |
172 | + <button name="%(sale.action_view_sale_advance_payment_inv)d" position="replace"> |
173 | + <button name="%(sale.action_view_sale_advance_payment_inv)d" string="Advance Invoice" |
174 | + type="action" icon="gtk-execute" states="manual" groups="base.group_extended"/> |
175 | + </button> |
176 | + </field> |
177 | + </record> |
178 | + |
179 | + |
180 | + <!-- Fin de Pagos--> |
181 | ============================= |
182 | Add button autorization on sale order |
183 | ============================= |
184 | @@ -11,7 +32,9 @@ |
185 | <field name="inherit_id" ref="sale.view_order_form"/> |
186 | <field name="arch" type="xml"> |
187 | <button name="button_dummy" position="after"> |
188 | - <button name="autorizacion" states="waiting_auto" string="Autorization" icon="gtk-apply" groups="account.group_account_manager"/> |
189 | + <button name="action_cancel" states="waiting_auto" string="Cancel Order" type="object" icon="gtk-cancel"/> |
190 | + <!-- <button name="autorizacion" states="waiting_auto" string="Autorization" icon="gtk-apply" groups="account.group_account_manager"/> --> |
191 | + <button name="order_autorizacion_object" states="waiting_auto" type="object" string="Autorization" icon="gtk-apply"/> |
192 | </button> |
193 | </field> |
194 | </record> |
195 | |
196 | === added directory 'bias_customization/voucher' |
197 | === added file 'bias_customization/voucher/__init__.py' |
198 | --- bias_customization/voucher/__init__.py 1970-01-01 00:00:00 +0000 |
199 | +++ bias_customization/voucher/__init__.py 2012-09-06 14:43:22 +0000 |
200 | @@ -0,0 +1,29 @@ |
201 | +# -*- encoding: utf-8 -*- |
202 | +############################################################################## |
203 | +# |
204 | +# OpenERP, Open Source Management Solution |
205 | +# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
206 | +# $Id$ |
207 | +# |
208 | +# This program is free software: you can redistribute it and/or modify |
209 | +# it under the terms of the GNU General Public License as published by |
210 | +# the Free Software Foundation, either version 3 of the License, or |
211 | +# (at your option) any later version. |
212 | +# |
213 | +# This program is distributed in the hope that it will be useful, |
214 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
215 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
216 | +# GNU General Public License for more details. |
217 | +# |
218 | +# You should have received a copy of the GNU General Public License |
219 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
220 | +# |
221 | +############################################################################## |
222 | + |
223 | +import account_voucher |
224 | +#import report |
225 | +#import invoice |
226 | +#import wizard |
227 | + |
228 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
229 | + |
230 | |
231 | === added file 'bias_customization/voucher/account_voucher.py' |
232 | --- bias_customization/voucher/account_voucher.py 1970-01-01 00:00:00 +0000 |
233 | +++ bias_customization/voucher/account_voucher.py 2012-09-06 14:43:22 +0000 |
234 | @@ -0,0 +1,52 @@ |
235 | +# -*- coding: utf-8 -*- |
236 | +############################################################################## |
237 | +# |
238 | +# OpenERP, Open Source Management Solution |
239 | +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
240 | +# |
241 | +# This program is free software: you can redistribute it and/or modify |
242 | +# it under the terms of the GNU Affero General Public License as |
243 | +# published by the Free Software Foundation, either version 3 of the |
244 | +# License, or (at your option) any later version. |
245 | +# |
246 | +# This program is distributed in the hope that it will be useful, |
247 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
248 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
249 | +# GNU Affero General Public License for more details. |
250 | +# |
251 | +# You should have received a copy of the GNU Affero General Public License |
252 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
253 | +# |
254 | +############################################################################## |
255 | + |
256 | +import time |
257 | +from lxml import etree |
258 | + |
259 | +import netsvc |
260 | +from osv import osv, fields |
261 | +import decimal_precision as dp |
262 | +from tools.translate import _ |
263 | + |
264 | + |
265 | +class account_voucher_line(osv.osv): |
266 | + _inherit = "account.voucher.line" |
267 | + |
268 | + def onchange_amount_id(self, cr, user, ids, move_line_id, amount, context=None): |
269 | + currency_pool = self.pool.get('res.currency') |
270 | + currency_pool = self.pool.get('account_voucher') |
271 | + move_line_pool = self.pool.get('account.move.line') |
272 | + print 'amount : ', amount |
273 | + if move_line_id: |
274 | + move_line = move_line_pool.browse(cr, user, move_line_id, context=context) |
275 | + print 'move_line ', move_line |
276 | + print 'move_line_id ', move_line_id |
277 | + print 'amount : ', amount |
278 | + return {} |
279 | + |
280 | + _columns = { |
281 | + 'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')), |
282 | + } |
283 | + |
284 | + |
285 | +account_voucher_line() |
286 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
287 | |
288 | === added file 'bias_customization/voucher/account_voucher_view.xml' |
289 | --- bias_customization/voucher/account_voucher_view.xml 1970-01-01 00:00:00 +0000 |
290 | +++ bias_customization/voucher/account_voucher_view.xml 2012-09-06 14:43:22 +0000 |
291 | @@ -0,0 +1,83 @@ |
292 | +<?xml version="1.0" encoding="UTF-8"?> |
293 | +<openerp> |
294 | + <data> |
295 | + |
296 | + <record model="ir.ui.view" id="view_voucher_line_form_inherit_01"> |
297 | + <field name="name">account.voucher.line.form.inherit.01</field> |
298 | + <field name="model">account.voucher.line</field> |
299 | + <field name="type">form</field> |
300 | + <field name="inherit_id" ref="account_voucher.view_voucher_line_form"/> |
301 | + <field name="arch" type="xml"> |
302 | + <field name="amount" position="replace"> |
303 | + <field name="amount" on_change="onchange_amount_id(move_line_id, amount)" /> |
304 | + </field> |
305 | + </field> |
306 | + </record> |
307 | + |
308 | + <record model="ir.ui.view" id="view_vendor_receipt_form_inherit_01"> |
309 | + <field name="name">account.voucher.receipt.form.inherit.01</field> |
310 | + <field name="model">account.voucher</field> |
311 | + <field name="type">form</field> |
312 | + <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/> |
313 | + <field name="arch" type="xml"> |
314 | + <xpath expr="/form/notebook/page/field[@name='line_dr_ids']/tree/field[@name='amount']" position="replace"> |
315 | + <field name="amount" on_change="onchange_amount_id(move_line_id, amount)" sum="Payment" /> |
316 | + </xpath> |
317 | + </field> |
318 | + </record> |
319 | + |
320 | + |
321 | + <!-- |
322 | + <record model="ir.ui.view" id="view_vendor_receipt_form_inherit_01"> |
323 | + <field name="name">account.voucher.receipt.form.inherit.01</field> |
324 | + <field name="model">account.voucher</field> |
325 | + <field name="type">form</field> |
326 | + <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/> |
327 | + <field name="arch" type="xml"> |
328 | + <xpath expr="/form/notebook/page/field[@name='line_dr_ids']/tree/field[@name='account_id']" position="after"> |
329 | + <field name="account_analytic_id"/> |
330 | + </xpath> |
331 | + <xpath expr="/form/notebook/page/field[@name='line_cr_ids']/tree/field[@name='account_id']" position="after"> |
332 | + <field name="account_analytic_id"/> |
333 | + </xpath> |
334 | + </field> |
335 | + </record> |
336 | + |
337 | + --> |
338 | + <!-- |
339 | + <record model="ir.ui.view" id="view_low_priority_payment_form_inherit_01"> |
340 | + <field name="name">account.voucher.payment.low.priority.form.inherit.01</field> |
341 | + <field name="model">account.voucher</field> |
342 | + <field name="type">form</field> |
343 | + <field name="priority">1</field> |
344 | + <field name="inherit_id" ref="account_voucher.view_low_priority_payment_form"/> |
345 | + <field name="arch" type="xml"> |
346 | + <xpath expr="/form/notebook/page/field[@name='line_dr_ids']/tree/field[@name='account_id']" position="after"> |
347 | + <field name="account_analytic_id"/> |
348 | + </xpath> |
349 | + <xpath expr="/form/notebook/page/field[@name='line_cr_ids']/tree/field[@name='account_id']" position="after"> |
350 | + <field name="account_analytic_id"/> |
351 | + </xpath> |
352 | + </field> |
353 | + </record> |
354 | + |
355 | + <record model="ir.ui.view" id="view_vendor_payment_form_inherit_01"> |
356 | + <field name="name">account.voucher.payment.form.inherit.01</field> |
357 | + <field name="model">account.voucher</field> |
358 | + <field name="type">form</field> |
359 | + <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/> |
360 | + <field name="arch" type="xml"> |
361 | + <xpath expr="/form/notebook/page/field[@name='line_dr_ids']/tree/field[@name='account_id']" position="after"> |
362 | + <field name="account_analytic_id"/> |
363 | + </xpath> |
364 | + <xpath expr="/form/notebook/page/field[@name='line_cr_ids']/tree/field[@name='account_id']" position="after"> |
365 | + <field name="account_analytic_id"/> |
366 | + </xpath> |
367 | + </field> |
368 | + </record> |
369 | + --> |
370 | + </data> |
371 | +</openerp> |
372 | + |
373 | + |
374 | + |