Merge lp:~vauxoo/addons-vauxoo/6.1-analysis_rent_by_period-dev_luis into lp:addons-vauxoo/6.1
- 6.1-analysis_rent_by_period-dev_luis
- Merge into 6.1
Proposed by
Luis Torres - http://www.vauxoo.com
Status: | Merged |
---|---|
Merged at revision: | 627 |
Proposed branch: | lp:~vauxoo/addons-vauxoo/6.1-analysis_rent_by_period-dev_luis |
Merge into: | lp:addons-vauxoo/6.1 |
Diff against target: |
1532 lines (+1368/-20) 10 files modified
account_analytic_analysis_rent/__init__.py (+1/-0) account_analytic_analysis_rent/__openerp__.py (+6/-2) account_analytic_analysis_rent/account_analytic_account_rent.py (+198/-9) account_analytic_analysis_rent/account_analytic_account_rent.xml (+166/-5) account_analytic_analysis_rent/i18n/es.po (+560/-0) account_analytic_analysis_rent/product.py (+41/-2) account_analytic_analysis_rent/product_view.xml (+68/-2) account_analytic_analysis_rent/wizard/__init__.py (+1/-0) account_analytic_analysis_rent/wizard/lines_invoice_create.py (+259/-0) account_analytic_analysis_rent/wizard/lines_invoice_create_view.xml (+68/-0) |
To merge this branch: | bzr merge lp:~vauxoo/addons-vauxoo/6.1-analysis_rent_by_period-dev_luis |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julio Serna-http://www.vauxoo.com | Pending | ||
Review via email: mp+206568@code.launchpad.net |
Commit message
Description of the change
Se cambio el campo mes por period_id, y se agrego que solo se agreguen lineas que corresponden al periodo que se desea facturar
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 | === modified file 'account_analytic_analysis_rent/__init__.py' |
2 | --- account_analytic_analysis_rent/__init__.py 2013-06-03 17:04:02 +0000 |
3 | +++ account_analytic_analysis_rent/__init__.py 2014-02-15 01:21:30 +0000 |
4 | @@ -1,3 +1,4 @@ |
5 | import account_analytic_account_rent |
6 | import product |
7 | import report |
8 | +import wizard |
9 | |
10 | === modified file 'account_analytic_analysis_rent/__openerp__.py' |
11 | --- account_analytic_analysis_rent/__openerp__.py 2013-06-03 17:04:02 +0000 |
12 | +++ account_analytic_analysis_rent/__openerp__.py 2014-02-15 01:21:30 +0000 |
13 | @@ -24,12 +24,16 @@ |
14 | 'name' : "Account Analytic Account Rent", |
15 | 'category' : "account_analytic", |
16 | 'version' : "1.0", |
17 | - 'depends' : ['account_analytic_analysis','product'], |
18 | + 'depends' : ['account_analytic_analysis','product','account_voucher'], |
19 | 'author' : "Vauxoo", |
20 | 'description' : """ |
21 | This module added product in account_analytic_analysis to product control |
22 | """, |
23 | - 'data' : ['account_analytic_account_rent.xml','product_view.xml','account_analytic_analysis_report.xml'], |
24 | + 'data' : ['account_analytic_account_rent.xml', |
25 | + 'product_view.xml', |
26 | + 'account_analytic_analysis_report.xml', |
27 | + 'wizard/lines_invoice_create_view.xml', |
28 | + ], |
29 | 'installable': True, |
30 | 'auto_install': False, |
31 | } |
32 | |
33 | === modified file 'account_analytic_analysis_rent/account_analytic_account_rent.py' |
34 | --- account_analytic_analysis_rent/account_analytic_account_rent.py 2013-06-03 17:04:02 +0000 |
35 | +++ account_analytic_analysis_rent/account_analytic_account_rent.py 2014-02-15 01:21:30 +0000 |
36 | @@ -22,12 +22,158 @@ |
37 | from openerp.osv import osv, fields |
38 | from datetime import datetime, timedelta |
39 | from tools.translate import _ |
40 | +from datetime import datetime, timedelta |
41 | +from dateutil.relativedelta import relativedelta |
42 | + |
43 | +class analytic_term(osv.osv): |
44 | + _name='analytic.term' |
45 | + |
46 | + _columns={ |
47 | + 'name': fields.char('Term',size=64,required=True), |
48 | + 'no_term': fields.integer('No Term') |
49 | + } |
50 | + |
51 | +class account_analytic_product(osv.osv): |
52 | + _name='account.analytic.product' |
53 | + |
54 | + |
55 | + def onchange_prodlot(self, cr , uid, ids, prodlot_id, context=None): |
56 | + if context==None: |
57 | + context={} |
58 | + res={} |
59 | + if prodlot_id: |
60 | + prodlot_obj=self.pool.get('stock.production.lot') |
61 | + if prodlot_obj.browse(cr, uid, prodlot_id, context=context).stock_available < 0: |
62 | + res={'value':{'prodlot_id': False },'warning':{ |
63 | + 'title': _('This product is already rented !'), |
64 | + 'message': _('This product is already rented,check serial number.') |
65 | + }} |
66 | + return res |
67 | + |
68 | + def onchange_product_id(self, cr, uid, ids, product_id, context=None): |
69 | + res={} |
70 | + list=[] |
71 | + if context==None: |
72 | + context={} |
73 | + if product_id: |
74 | + product_obj=self.pool.get('product.product') |
75 | + for prod in product_obj.browse(cr, uid, [product_id], context): |
76 | + type='rent' |
77 | + if prod.accesory_ok: |
78 | + type='accesory' |
79 | + list_data = [{'name':feature.name.id} for feature in prod.feature_ids] |
80 | + res={'value':{'type': type, }} |
81 | + return res |
82 | + |
83 | + _columns={ |
84 | + 'product_id':fields.many2one('product.product','Product', required=True, domain=['|', ('rent_ok','=',True), ('accesory_ok','=',True) ]), |
85 | + 'type': fields.selection([('rent','Rent'),('accesory','Accesory')],'Type'), |
86 | + 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', help="Production lot is used to put a serial number on the production", select=True), |
87 | + 'analytic_id':fields.many2one('account.analytic.account','Account Analytic') |
88 | + } |
89 | + |
90 | +class account_analytic_line(osv.osv): |
91 | + _inherit='account.analytic.line' |
92 | + _order='product_id' |
93 | + |
94 | + def _check_inv(self, cr, uid, ids, vals): |
95 | + select = ids |
96 | + if isinstance(select, (int, long)): |
97 | + select = [ids] |
98 | + if ( not vals.has_key('invoice_id')) or vals['invoice_id' ] == False: |
99 | + for line in self.browse(cr, uid, select): |
100 | + if line.invoice_id and 'account_id' not in vals: |
101 | + raise osv.except_osv(_('Error !'), |
102 | + _('You cannot modify an invoiced analytic lines!')) |
103 | + return True |
104 | + |
105 | + def onchange_copys(self, cr, uid, id, w_start, w_end, context=None): |
106 | + res={} |
107 | + if context==None: |
108 | + context={} |
109 | + return {'value':{'unit_amount': w_end - w_start} } |
110 | + |
111 | + _columns={ |
112 | + 'w_start': fields.integer('Inicial'), |
113 | + 'w_end': fields.integer('Final'), |
114 | + 'feature_id': fields.many2one('product.feature.line','Feature'), |
115 | + 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', help="Production lot is used to put a serial number on the production", select=True), |
116 | + } |
117 | + |
118 | + |
119 | +class account_invoice_line(osv.osv): |
120 | + _inherit='account.invoice.line' |
121 | + |
122 | + _columns={ |
123 | + 'w_start': fields.integer('Inicial'), |
124 | + 'w_end': fields.integer('Final'), |
125 | + 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', help="Production lot is used to put a serial number on the production", select=True), |
126 | + } |
127 | +account_invoice_line() |
128 | + |
129 | |
130 | class account_analytic_account(osv.osv): |
131 | _inherit='account.analytic.account' |
132 | |
133 | + def onchange_product_lines(self, cr, uid, ids, product_ids, feature_ids, context=None): |
134 | + res={} |
135 | + list_feature=[] |
136 | + if context==None: |
137 | + context={} |
138 | + if product_ids: |
139 | + product_obj=self.pool.get('product.product') |
140 | + for prod in product_ids: |
141 | + if prod[2]['product_id']: |
142 | + for feature in product_obj.browse(cr, uid, prod[2]['product_id'], context=context).feature_ids: |
143 | + list_feature.append({'name': feature.name and feature.name.id or False, 'product_line_id':prod[2]['product_id'],'counter':feature.counter or False, 'prodlot_feature_id' : prod[2]['prodlot_id']}) |
144 | + return {'value':{'feature_ids': [(0, 6, data) for data in list_feature]}} |
145 | + |
146 | + def _get_journal(self, cr, uid, context=None): |
147 | + if context is None: |
148 | + context = {} |
149 | + type_inv = context.get('type', 'out_invoice') |
150 | + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) |
151 | + company_id = context.get('company_id', user.company_id.id) |
152 | + type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'} |
153 | + journal_obj = self.pool.get('account.journal') |
154 | + res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale')), |
155 | + ('company_id', '=', company_id)], |
156 | + limit=1) |
157 | + return res and res[0] or False |
158 | + |
159 | + def _compute_lines(self, cr, uid, ids, name, args, context=None): |
160 | + result = {} |
161 | + for contract in self.browse(cr, uid, ids, context=context): |
162 | + src = [] |
163 | + lines = [] |
164 | + for line in contract.line_ids: |
165 | + if line.invoice_id: |
166 | + if line.invoice_id.state=='paid': |
167 | + for l in line.invoice_id.payment_ids: |
168 | + if l.id not in lines: |
169 | + lines.append(l.id) |
170 | + result[contract.id] = lines |
171 | + return result |
172 | + |
173 | + def _compute_lines_inv(self, cr, uid, ids, name, args, context=None): |
174 | + result = {} |
175 | + for contract in self.browse(cr, uid, ids, context=context): |
176 | + src = [] |
177 | + lines = [] |
178 | + for line in contract.line_ids: |
179 | + if line.invoice_id and line.invoice_id.id not in lines: |
180 | + lines.append(line.invoice_id.id) |
181 | + result[contract.id]=lines |
182 | + return result |
183 | + |
184 | _columns={ |
185 | - 'product_id':fields.many2one('product.product','Product', domain=[('rent','=',False), ('rent_ok','=',True)]), |
186 | + 'product_ids':fields.one2many('account.analytic.product','analytic_id', 'Products'), |
187 | + 'term_id': fields.many2one('analytic.term','Term', required=True), |
188 | + 'voucher_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'), |
189 | + 'invoice_ids': fields.function(_compute_lines_inv, relation='account.invoice', type="many2many", string='Invoice'), |
190 | + 'group_product': fields.boolean('Group Product'), |
191 | + 'journal_id':fields.many2one('account.journal','Journal', required=True), |
192 | + 'feature_ids': fields.one2many('product.feature.line', 'analytic_id', 'Features') |
193 | } |
194 | |
195 | def set_close(self, cr, uid, ids, context=None): |
196 | @@ -37,10 +183,16 @@ |
197 | product_obj=self.pool.get('product.product') |
198 | ware_id=warehouse_obj.search(cr, uid, [], context=context)[0] |
199 | warehouse=warehouse_obj.browse(cr ,uid, ware_id, context=context) |
200 | + location = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'customer')], context=context) |
201 | + if location: |
202 | + location=location[0] |
203 | + else: |
204 | + raise osv.except_osv(_('Error!'), _('You not have a configured client location')) |
205 | for contract in self.browse(cr, uid , ids , context=context): |
206 | - picking_id=picking_obj.create(cr, uid, {'origin':contract.name, 'address_id':contract.contact_id.id,'date':contract.date_start,'type':'in'}, context=context) |
207 | - move_obj.create(cr, uid, {'name':contract.product_id.name,'product_id':contract.product_id.id,'product_qty':1,'picking_id':picking_id,'product_uom':contract.product_id.uom_id.id,'location_id':warehouse.lot_output_id.id,'location_dest_id':warehouse.lot_input_id.id}, context=context) |
208 | - product_obj.write(cr, uid, contract.product_id.id, {'rent':False, 'contract_id': False}, context=context) |
209 | + picking_id=picking_obj.create(cr, uid, {'origin':contract.name or False, 'address_id': contract.contact_id and contract.contact_id.id or False,'date':contract.date_start or False,'type':'in'}, context=context) |
210 | + for prod in contract.product_ids: |
211 | + move_obj.create(cr, uid, {'name':prod.product_id.name,'product_id':prod.product_id.id,'product_qty':1,'picking_id':picking_id,'product_uom':prod.product_id.uom_id.id,'location_id':location,'location_dest_id': warehouse.lot_input_id and warehouse.lot_input_id.id or False, 'prodlot_id': prod.prodlot_id and prod.prodlot_id.id or 1}, context=context) |
212 | + product_obj.write(cr, uid, prod.product_id.id, {'rent':False, 'contract_id': False}, context=context) |
213 | return super(account_analytic_account, self).set_close(cr, uid, ids, context=context) |
214 | |
215 | def set_open(self, cr, uid, ids, context=None): |
216 | @@ -48,17 +200,45 @@ |
217 | move_obj=self.pool.get('stock.move') |
218 | warehouse_obj=self.pool.get('stock.warehouse') |
219 | product_obj=self.pool.get('product.product') |
220 | + line_obj=self.pool.get('account.analytic.line') |
221 | ware_id=warehouse_obj.search(cr, uid, [], context=context)[0] |
222 | warehouse=warehouse_obj.browse(cr ,uid, ware_id, context=context) |
223 | |
224 | for contract in self.browse(cr, uid , ids , context=context): |
225 | - picking_id=picking_obj.create(cr, uid, {'origin':contract.name, 'address_id':contract.contact_id.id,'date':contract.date_start,'type':'out'}, context=context) |
226 | - move_obj.create(cr, uid, {'name':contract.product_id.name,'product_id':contract.product_id.id,'product_qty':1,'picking_id':picking_id,'product_uom':contract.product_id.uom_id.id,'location_id':warehouse.lot_stock_id.id,'location_dest_id':warehouse.lot_output_id.id}, context=context) |
227 | - product_obj.write(cr, uid, contract.product_id.id, {'rent':True,'contract_id':contract.id}, context=context) |
228 | + date_invoice=contract.date_start |
229 | + #~ date_invoice=datetime.strptime(contract.date_start, "%Y-%m-%d") |
230 | + picking_id=picking_obj.create(cr, uid, {'origin':contract.name, 'address_id': contract.contact_id and contract.contact_id.id or False,'date':contract.date_start,'type':'out'}, context=context) |
231 | + for prod in contract.product_ids: |
232 | + move_obj.create(cr, uid, {'name':prod.product_id.name,'product_id':prod.product_id.id,'product_qty':1,'picking_id':picking_id,'product_uom':prod.product_id.uom_id.id,'location_id': warehouse.lot_stock_id and warehouse.lot_stock_id.id or False,'location_dest_id': warehouse.lot_output_id and warehouse.lot_output_id.id or False, 'prodlot_id': prod.prodlot_id and prod.prodlot_id.id or 1}, context=context) |
233 | + for line in range(0,contract.term_id.no_term): |
234 | + for prod in contract.product_ids: |
235 | + a = prod.product_id.product_tmpl_id.property_account_income.id |
236 | + if not a: |
237 | + a = prod.product_id.categ_id.property_account_income_categ.id |
238 | + for feature in contract.feature_ids: |
239 | + if feature.product_line_id.id==prod.product_id.id: |
240 | + line_obj.create(cr, uid, {'date':date_invoice,'name':feature.name and feature.name.name or False,'product_id':prod.product_id.id,'product_uom_id':prod.product_id.uom_id.id,'general_account_id':a,'to_invoice':1,'account_id': contract and contract.id or False,'journal_id': contract.journal_id and contract.journal_id.analytic_journal_id and contract.journal_id.analytic_journal_id.id or False,'amount': feature and feature.cost or False, 'feature_id':feature and feature.id or False, 'prodlot_id': prod.prodlot_id and prod.prodlot_id.id or 1},context=context) |
241 | + product_obj.write(cr, uid, prod.product_id.id, {'rent':True,'contract_id': contract and contract.id or False}, context=context) |
242 | + date_invoice=(datetime.strptime(date_invoice, "%Y-%m-%d") + relativedelta(months=1)).strftime("%Y-%m-%d") |
243 | return super(account_analytic_account, self).set_open(cr, uid, ids, context=context) |
244 | |
245 | + def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): |
246 | + journal_obj = self.pool.get('account.journal') |
247 | + if context is None: |
248 | + context = {} |
249 | + res = super(account_analytic_account,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) |
250 | + type = 'sale' |
251 | + for field in res['fields']: |
252 | + if field == 'journal_id' and type: |
253 | + journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1) |
254 | + res['fields'][field]['selection'] = journal_select |
255 | + |
256 | + return res |
257 | + |
258 | _defaults = { |
259 | 'state': 'draft', |
260 | + 'group_product': True, |
261 | + 'journal_id': _get_journal, |
262 | } |
263 | account_analytic_account() |
264 | |
265 | @@ -77,5 +257,14 @@ |
266 | res['product']=line.product_id.id |
267 | return res |
268 | hr_timesheet_invoice_create() |
269 | - |
270 | - |
271 | + |
272 | + |
273 | +class stock_production_lot(osv.osv): |
274 | + _inherit='stock.production.lot' |
275 | + |
276 | + def name_get(self, cr, uid, ids, context=None): |
277 | + if ids and ids[0] == False: |
278 | + ids=[] |
279 | + return super(stock_production_lot, self).name_get( |
280 | + cr, uid, ids, context=context) |
281 | +stock_production_lot() |
282 | |
283 | === modified file 'account_analytic_analysis_rent/account_analytic_account_rent.xml' |
284 | --- account_analytic_analysis_rent/account_analytic_account_rent.xml 2013-06-03 17:04:02 +0000 |
285 | +++ account_analytic_analysis_rent/account_analytic_account_rent.xml 2014-02-15 01:21:30 +0000 |
286 | @@ -10,11 +10,172 @@ |
287 | <field name="arch" type="xml"> |
288 | <notebook position="inside"> |
289 | <page string="Product"> |
290 | - <field name="product_id"/> |
291 | - </page> |
292 | - </notebook> |
293 | - </field> |
294 | - </record> |
295 | + <field name="product_ids" on_change="onchange_product_lines(product_ids, feature_ids)" nolabel="1"> |
296 | + <tree string="products" editable="top"> |
297 | + <field name="product_id" on_change="onchange_product_id(product_id)"/> |
298 | + <field name="prodlot_id" |
299 | + context="{'product_id':product_id}" |
300 | + domain="[('product_id','=?',product_id)]" |
301 | + on_change="onchange_prodlot(prodlot_id)"/> |
302 | + <field name="type"/> |
303 | + </tree> |
304 | + <form string="products"> |
305 | + <field name="product_id" on_change="onchange_product_id(product_id)"/> |
306 | + <field name="prodlot_id" |
307 | + context="{'product_id':product_id}" |
308 | + domain="[('product_id','=?',product_id)]" |
309 | + on_change="onchange_prodlot(prodlot_id)"/> |
310 | + <field name="type"/> |
311 | + </form> |
312 | + </field> |
313 | + <newline/> |
314 | + <field name="feature_ids" nolabel="1"> |
315 | + <tree string='Features' editable="top"> |
316 | + <field name="product_line_id"/> |
317 | + <field name="name"/> |
318 | + <field name="counter"/> |
319 | + <field name="cost"/> |
320 | + <field name="prodlot_feature_id" invisible = '1'/> |
321 | + </tree> |
322 | + <form string='Features'> |
323 | + <field name="product_line_id"/> |
324 | + <field name="name"/> |
325 | + <field name="counter"/> |
326 | + <field name="cost"/> |
327 | + </form> |
328 | + </field> |
329 | + </page> |
330 | + </notebook> |
331 | + </field> |
332 | + </record> |
333 | + |
334 | + <record model="ir.ui.view" id="account_analytic_analysis_invoice_page"> |
335 | + <field name="name">account.analytic.analysis.invoice.page</field> |
336 | + <field name="model">account.analytic.account</field> |
337 | + <field name="type">form</field> |
338 | + <field name="inherit_id" ref="account.view_account_analytic_account_form"/> |
339 | + <field name="arch" type="xml"> |
340 | + <notebook position="inside"> |
341 | + <page string="Invoice"> |
342 | + <field name="invoice_ids" nolabel="1"/> |
343 | + </page> |
344 | + </notebook> |
345 | + </field> |
346 | + </record> |
347 | + |
348 | + <record model="ir.ui.view" id="account_analytic_analysis_payments"> |
349 | + <field name="name">account.analytic.analysis.payments</field> |
350 | + <field name="model">account.analytic.account</field> |
351 | + <field name="type">form</field> |
352 | + <field name="inherit_id" ref="account.view_account_analytic_account_form"/> |
353 | + <field name="arch" type="xml"> |
354 | + <notebook position="inside"> |
355 | + <page string="Payments"> |
356 | + <field name="voucher_ids" nolabel="1"/> |
357 | + </page> |
358 | + </notebook> |
359 | + </field> |
360 | + </record> |
361 | + |
362 | + |
363 | + <record id="view_analytic_term_tree" model="ir.ui.view"> |
364 | + <field name="name">view.analytic.term.tree</field> |
365 | + <field name="model">analytic.term</field> |
366 | + <field name="type">tree</field> |
367 | + <field name="arch" type="xml"> |
368 | + <tree string="Analytic Term"> |
369 | + <field name="name"/> |
370 | + <field name="no_term"/> |
371 | + </tree> |
372 | + </field> |
373 | + </record> |
374 | + |
375 | + <record id="view_analytic_term_form" model="ir.ui.view"> |
376 | + <field name="name">view.analytic.term.form</field> |
377 | + <field name="model">analytic.term</field> |
378 | + <field name="type">form</field> |
379 | + <field name="arch" type="xml"> |
380 | + <form string="Analytic Term"> |
381 | + <field name="name"/> |
382 | + <field name="no_term"/> |
383 | + </form> |
384 | + </field> |
385 | + </record> |
386 | + |
387 | + <record model="ir.actions.act_window" id="analytic_term_action"> |
388 | + <field name="name">Analytic Term</field> |
389 | + <field name="res_model">analytic.term</field> |
390 | + <field name="view_type">form</field> |
391 | + <field name="view_mode">tree,form</field> |
392 | + </record> |
393 | + <menuitem id="analytic_contract" name="Contract" parent="base.menu_sale_config_sales"/> |
394 | + <menuitem action="analytic_term_action" id="analytic_term_action_menu" parent="analytic_contract"/> |
395 | + |
396 | + |
397 | + <record model="ir.ui.view" id="account_analytic_analysis_term_contract"> |
398 | + <field name="name">account.analytic.analysis.term.contract</field> |
399 | + <field name="model">account.analytic.account</field> |
400 | + <field name="type">form</field> |
401 | + <field name="inherit_id" ref="account.view_account_analytic_account_form"/> |
402 | + <field name="arch" type="xml"> |
403 | + <field name="quantity_max" position="after"> |
404 | + <field name="term_id"/> |
405 | + </field> |
406 | + </field> |
407 | + </record> |
408 | + |
409 | + <record model="ir.ui.view" id="account_analytic_analysis_journal_contract"> |
410 | + <field name="name">account.analytic.analysis.journal.contract</field> |
411 | + <field name="model">account.analytic.account</field> |
412 | + <field name="type">form</field> |
413 | + <field name="inherit_id" ref="account.view_account_analytic_account_form"/> |
414 | + <field name="arch" type="xml"> |
415 | + <field name="user_id" position="after"> |
416 | + <field name="journal_id" widget="selection"/> |
417 | + </field> |
418 | + </field> |
419 | + </record> |
420 | + |
421 | + <record model="ir.ui.view" id="account_analytic_analysis_group_prod"> |
422 | + <field name="name">account.analytic.analysis.group.prod</field> |
423 | + <field name="model">account.analytic.account</field> |
424 | + <field name="type">form</field> |
425 | + <field name="inherit_id" ref="hr_timesheet_invoice.account_analytic_account_form_form"/> |
426 | + <field name="arch" type="xml"> |
427 | + <field name="amount_invoiced" position="after"> |
428 | + <field name="group_product"/> |
429 | + </field> |
430 | + </field> |
431 | + </record> |
432 | + |
433 | + |
434 | + <record model="ir.ui.view" id="account_analytic_line_product_visible"> |
435 | + <field name="name">account.analytic.line.product.visible</field> |
436 | + <field name="model">account.analytic.line</field> |
437 | + <field name="type">form</field> |
438 | + <field name="inherit_id" ref="account.view_account_analytic_line_tree"/> |
439 | + <field name="arch" type="xml"> |
440 | + <field name="product_id" position="replace"> |
441 | + <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" /> |
442 | + </field> |
443 | + </field> |
444 | + </record> |
445 | + |
446 | + <record model="ir.ui.view" id="account_invoice_line_write"> |
447 | + <field name="name">account.invoice.line_write</field> |
448 | + <field name="model">account.invoice.line</field> |
449 | + <field name="type">form</field> |
450 | + <field name="inherit_id" ref="account.view_invoice_line_tree"/> |
451 | + <field name="arch" type="xml"> |
452 | + <field name="name" position="after"> |
453 | + <field name="product_id" /> |
454 | + <field name="prodlot_id" /> |
455 | + <field name="w_start" /> |
456 | + <field name="w_end" /> |
457 | + </field> |
458 | + </field> |
459 | + </record> |
460 | + |
461 | |
462 | </data> |
463 | </openerp> |
464 | |
465 | === added directory 'account_analytic_analysis_rent/i18n' |
466 | === added file 'account_analytic_analysis_rent/i18n/es.po' |
467 | --- account_analytic_analysis_rent/i18n/es.po 1970-01-01 00:00:00 +0000 |
468 | +++ account_analytic_analysis_rent/i18n/es.po 2014-02-15 01:21:30 +0000 |
469 | @@ -0,0 +1,560 @@ |
470 | +# Translation of OpenERP Server. |
471 | +# This file contains the translation of the following modules: |
472 | +# * account_analytic_analysis_rent |
473 | +# |
474 | +msgid "" |
475 | +msgstr "" |
476 | +"Project-Id-Version: OpenERP Server 6.1\n" |
477 | +"Report-Msgid-Bugs-To: \n" |
478 | +"POT-Creation-Date: 2014-02-15 01:01+0000\n" |
479 | +"PO-Revision-Date: 2014-02-15 01:01+0000\n" |
480 | +"Last-Translator: <>\n" |
481 | +"Language-Team: \n" |
482 | +"MIME-Version: 1.0\n" |
483 | +"Content-Type: text/plain; charset=UTF-8\n" |
484 | +"Content-Transfer-Encoding: \n" |
485 | +"Plural-Forms: \n" |
486 | + |
487 | +#. module: account_analytic_analysis_rent |
488 | +#: report:account.analytic.account.report:0 |
489 | +msgid "Contratos" |
490 | +msgstr "Contratos" |
491 | + |
492 | +#. module: account_analytic_analysis_rent |
493 | +#: field:account.analytic.line,w_end:0 |
494 | +#: field:account.invoice.line,w_end:0 |
495 | +msgid "Final" |
496 | +msgstr "Final" |
497 | + |
498 | +#. module: account_analytic_analysis_rent |
499 | +#: view:product.product:0 |
500 | +msgid "Services" |
501 | +msgstr "Servicios" |
502 | + |
503 | +#. module: account_analytic_analysis_rent |
504 | +#: code:addons/account_analytic_analysis_rent/account_analytic_account_rent.py:190 |
505 | +#, python-format |
506 | +msgid "Error!" |
507 | +msgstr "Error!" |
508 | + |
509 | +#. module: account_analytic_analysis_rent |
510 | +#: model:ir.model,name:account_analytic_analysis_rent.model_account_analytic_product |
511 | +msgid "account.analytic.product" |
512 | +msgstr "account.analytic.product" |
513 | + |
514 | +#. module: account_analytic_analysis_rent |
515 | +#: view:analytic.term:0 |
516 | +#: model:ir.actions.act_window,name:account_analytic_analysis_rent.analytic_term_action |
517 | +#: model:ir.ui.menu,name:account_analytic_analysis_rent.analytic_term_action_menu |
518 | +msgid "Analytic Term" |
519 | +msgstr "Plazo Analítico" |
520 | + |
521 | +#. module: account_analytic_analysis_rent |
522 | +#: report:account.analytic.account.report:0 |
523 | +msgid "Para el c" |
524 | +msgstr "Para el c" |
525 | + |
526 | +#. module: account_analytic_analysis_rent |
527 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:239 |
528 | +#, python-format |
529 | +msgid "Warning !" |
530 | +msgstr "Advertencia !" |
531 | + |
532 | +#. module: account_analytic_analysis_rent |
533 | +#: model:ir.model,name:account_analytic_analysis_rent.model_hr_timesheet_invoice_create |
534 | +msgid "Create invoice from timesheet" |
535 | +msgstr "Crear factura desde hoja de servicios" |
536 | + |
537 | +#. module: account_analytic_analysis_rent |
538 | +#: report:account.analytic.account.report:0 |
539 | +msgid "Firma Cliente:" |
540 | +msgstr "Firma Cliente:" |
541 | + |
542 | +#. module: account_analytic_analysis_rent |
543 | +#: view:lines.create:0 |
544 | +msgid "Create Invoices" |
545 | +msgstr "Crear Factura" |
546 | + |
547 | +#. module: account_analytic_analysis_rent |
548 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:65 |
549 | +#, python-format |
550 | +msgid "Analytic Account incomplete" |
551 | +msgstr "Cuenta Analítica Incompleta" |
552 | + |
553 | +#. module: account_analytic_analysis_rent |
554 | +#: report:account.analytic.account.report:0 |
555 | +msgid "____________________" |
556 | +msgstr "____________________" |
557 | + |
558 | +#. module: account_analytic_analysis_rent |
559 | +#: field:account.analytic.line,w_start:0 |
560 | +#: field:account.invoice.line,w_start:0 |
561 | +msgid "Inicial" |
562 | +msgstr "Inicial" |
563 | + |
564 | +#. module: account_analytic_analysis_rent |
565 | +#: constraint:account.analytic.account:0 |
566 | +msgid "Error! You can not create recursive analytic accounts." |
567 | +msgstr "¡Error! No se pueden crear cuentas analíticas recursivas." |
568 | + |
569 | +#. module: account_analytic_analysis_rent |
570 | +#: model:ir.model,name:account_analytic_analysis_rent.model_stock_production_lot |
571 | +msgid "Production lot" |
572 | +msgstr "Lote de producción" |
573 | + |
574 | +#. module: account_analytic_analysis_rent |
575 | +#: model:ir.actions.act_window,name:account_analytic_analysis_rent.product_accesory_action |
576 | +#: model:ir.ui.menu,name:account_analytic_analysis_rent.product_accesory_action_menu |
577 | +msgid "Accesory Product" |
578 | +msgstr "Accesorio Producto" |
579 | + |
580 | +#. module: account_analytic_analysis_rent |
581 | +#: model:ir.model,name:account_analytic_analysis_rent.model_lines_create_line |
582 | +msgid "lines.create.line" |
583 | +msgstr "lines.create.line" |
584 | + |
585 | +#. module: account_analytic_analysis_rent |
586 | +#: constraint:res.company:0 |
587 | +msgid "Error! You can not create recursive companies." |
588 | +msgstr "¡Error! No puede crear compañías recursivas." |
589 | + |
590 | +#. module: account_analytic_analysis_rent |
591 | +#: field:product.feature.line,cost:0 |
592 | +msgid "cost" |
593 | +msgstr "Costo" |
594 | + |
595 | +#. module: account_analytic_analysis_rent |
596 | +#: field:account.analytic.account,group_product:0 |
597 | +msgid "Group Product" |
598 | +msgstr "Grupo Producto" |
599 | + |
600 | +#. module: account_analytic_analysis_rent |
601 | +#: sql_constraint:stock.production.lot:0 |
602 | +msgid "The combination of serial number and internal reference must be unique !" |
603 | +msgstr "¡La combinación de número de serie y referencia interna debe ser única!" |
604 | + |
605 | +#. module: account_analytic_analysis_rent |
606 | +#: report:account.analytic.account.report:0 |
607 | +msgid "Terminos:" |
608 | +msgstr "Terminos:" |
609 | + |
610 | +#. module: account_analytic_analysis_rent |
611 | +#: model:ir.model,name:account_analytic_analysis_rent.model_account_analytic_account |
612 | +msgid "Analytic Account" |
613 | +msgstr "Cuenta Analítica" |
614 | + |
615 | +#. module: account_analytic_analysis_rent |
616 | +#: code:addons/account_analytic_analysis_rent/account_analytic_account_rent.py:86 |
617 | +#, python-format |
618 | +msgid "Error !" |
619 | +msgstr "Error !" |
620 | + |
621 | +#. module: account_analytic_analysis_rent |
622 | +#: code:addons/account_analytic_analysis_rent/account_analytic_account_rent.py:49 |
623 | +#, python-format |
624 | +msgid "This product is already rented,check serial number." |
625 | +msgstr "Este producto ya esta rentado, revisa el número de serie." |
626 | + |
627 | +#. module: account_analytic_analysis_rent |
628 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:69 |
629 | +#, python-format |
630 | +msgid "Partner incomplete" |
631 | +msgstr "Partner incompleto" |
632 | + |
633 | +#. module: account_analytic_analysis_rent |
634 | +#: report:account.analytic.account.report:0 |
635 | +msgid "___________________" |
636 | +msgstr "___________________" |
637 | + |
638 | +#. module: account_analytic_analysis_rent |
639 | +#: report:account.analytic.account.report:0 |
640 | +msgid "Cliente:" |
641 | +msgstr "Cliente:" |
642 | + |
643 | +#. module: account_analytic_analysis_rent |
644 | +#: field:account.analytic.account,term_id:0 |
645 | +#: field:analytic.term,name:0 |
646 | +msgid "Term" |
647 | +msgstr "Termino" |
648 | + |
649 | +#. module: account_analytic_analysis_rent |
650 | +#: model:ir.model,name:account_analytic_analysis_rent.model_analytic_term |
651 | +msgid "analytic.term" |
652 | +msgstr "analytic.term" |
653 | + |
654 | +#. module: account_analytic_analysis_rent |
655 | +#: field:product.feature.line,counter:0 |
656 | +msgid "Counter" |
657 | +msgstr "Contador" |
658 | + |
659 | +#. module: account_analytic_analysis_rent |
660 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:124 |
661 | +#, python-format |
662 | +msgid "Configuration Error" |
663 | +msgstr "Error de Configuración" |
664 | + |
665 | +#. module: account_analytic_analysis_rent |
666 | +#: code:addons/account_analytic_analysis_rent/account_analytic_account_rent.py:190 |
667 | +#, python-format |
668 | +msgid "You not have a configured client location" |
669 | +msgstr "No se tiene configurada una ubicación de cliente" |
670 | + |
671 | +#. module: account_analytic_analysis_rent |
672 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:252 |
673 | +#, python-format |
674 | +msgid "Invoices" |
675 | +msgstr "Facturas" |
676 | + |
677 | +#. module: account_analytic_analysis_rent |
678 | +#: model:ir.model,name:account_analytic_analysis_rent.model_account_invoice_line |
679 | +msgid "Invoice Line" |
680 | +msgstr "Línea de factura" |
681 | + |
682 | +#. module: account_analytic_analysis_rent |
683 | +#: view:account.analytic.account:0 |
684 | +msgid "products" |
685 | +msgstr "Productos" |
686 | + |
687 | +#. module: account_analytic_analysis_rent |
688 | +#: field:lines.create,date_start:0 |
689 | +msgid "Start Date" |
690 | +msgstr "Fecha Inicial" |
691 | + |
692 | +#. module: account_analytic_analysis_rent |
693 | +#: model:ir.actions.act_window,name:account_analytic_analysis_rent.product_rent_action |
694 | +#: model:ir.ui.menu,name:account_analytic_analysis_rent.product_rent_action_menu |
695 | +msgid "Rent Product" |
696 | +msgstr "Rentar Producto" |
697 | + |
698 | +#. module: account_analytic_analysis_rent |
699 | +#: code:addons/account_analytic_analysis_rent/account_analytic_account_rent.py:48 |
700 | +#, python-format |
701 | +msgid "This product is already rented !" |
702 | +msgstr "Este producto ya esta rentado !" |
703 | + |
704 | +#. module: account_analytic_analysis_rent |
705 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:239 |
706 | +#, python-format |
707 | +msgid "Invoice is already linked to some of the analytic line(s)!" |
708 | +msgstr "La factura ya esta relacionada a alguna linea analítica!" |
709 | + |
710 | +#. module: account_analytic_analysis_rent |
711 | +#: field:analytic.term,no_term:0 |
712 | +msgid "No Term" |
713 | +msgstr "No Termino" |
714 | + |
715 | +#. module: account_analytic_analysis_rent |
716 | +#: constraint:product.template:0 |
717 | +msgid "Error: The default UOM and the purchase UOM must be in the same category." |
718 | +msgstr "Error: La UdM por defecto y la UdM de compra deben estar en la misma categoría." |
719 | + |
720 | +#. module: account_analytic_analysis_rent |
721 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:124 |
722 | +#, python-format |
723 | +msgid "No income account defined for product '%s'" |
724 | +msgstr "No hay cuenta de ingresos definida para el producto '%s'" |
725 | + |
726 | +#. module: account_analytic_analysis_rent |
727 | +#: report:account.analytic.account.report:0 |
728 | +msgid "desde el d" |
729 | +msgstr "desde el d" |
730 | + |
731 | +#. module: account_analytic_analysis_rent |
732 | +#: report:account.analytic.account.report:0 |
733 | +msgid "Fecha Inicial :" |
734 | +msgstr "Fecha Inicial :" |
735 | + |
736 | +#. module: account_analytic_analysis_rent |
737 | +#: model:ir.model,name:account_analytic_analysis_rent.model_account_analytic_line |
738 | +msgid "Analytic Line" |
739 | +msgstr "Línea analítica" |
740 | + |
741 | +#. module: account_analytic_analysis_rent |
742 | +#: report:account.analytic.account.report:0 |
743 | +msgid "í" |
744 | +msgstr "í" |
745 | + |
746 | +#. module: account_analytic_analysis_rent |
747 | +#: report:account.analytic.account.report:0 |
748 | +msgid "." |
749 | +msgstr "." |
750 | + |
751 | +#. module: account_analytic_analysis_rent |
752 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:70 |
753 | +#, python-format |
754 | +msgid "Please fill in the Address field in the Partner: %s." |
755 | +msgstr "Por Favor llene la dirección del partner: %s." |
756 | + |
757 | +#. module: account_analytic_analysis_rent |
758 | +#: field:product.template,rent_ok:0 |
759 | +msgid "Rentable" |
760 | +msgstr "Rentable" |
761 | + |
762 | +#. module: account_analytic_analysis_rent |
763 | +#: model:ir.model,name:account_analytic_analysis_rent.model_res_company |
764 | +msgid "Companies" |
765 | +msgstr "Compañías" |
766 | + |
767 | +#. module: account_analytic_analysis_rent |
768 | +#: model:ir.actions.report.xml,name:account_analytic_analysis_rent.report_account_analytic_account |
769 | +#: model:ir.ui.menu,name:account_analytic_analysis_rent.analytic_contract |
770 | +#: field:lines.create,contract_id:0 |
771 | +#: field:product.template,contract_id:0 |
772 | +msgid "Contract" |
773 | +msgstr "Contrato" |
774 | + |
775 | +#. module: account_analytic_analysis_rent |
776 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:108 |
777 | +#, python-format |
778 | +msgid "Error" |
779 | +msgstr "Error" |
780 | + |
781 | +#. module: account_analytic_analysis_rent |
782 | +#: report:account.analytic.account.report:0 |
783 | +msgid "Sirva este documento para hacer valer el contrato del equipo:" |
784 | +msgstr "Sirva este documento para hacer valer el contrato del equipo:" |
785 | + |
786 | +#. module: account_analytic_analysis_rent |
787 | +#: field:account.analytic.line,prodlot_id:0 |
788 | +#: field:account.analytic.product,prodlot_id:0 |
789 | +#: field:product.feature.line,prodlot_feature_id:0 |
790 | +msgid "Production Lot" |
791 | +msgstr "Lote de Producción" |
792 | + |
793 | +#. module: account_analytic_analysis_rent |
794 | +#: help:account.analytic.line,prodlot_id:0 |
795 | +#: help:account.analytic.product,prodlot_id:0 |
796 | +#: help:product.feature.line,prodlot_feature_id:0 |
797 | +msgid "Production lot is used to put a serial number on the production" |
798 | +msgstr "El lote de producción se utiliza para colocar el número de serie en la producción" |
799 | + |
800 | +#. module: account_analytic_analysis_rent |
801 | +#: view:account.analytic.account:0 |
802 | +#: field:account.analytic.account,feature_ids:0 |
803 | +#: model:ir.actions.act_window,name:account_analytic_analysis_rent.product_feature_action |
804 | +#: model:ir.ui.menu,name:account_analytic_analysis_rent.product_feature |
805 | +#: model:ir.ui.menu,name:account_analytic_analysis_rent.product_feature_action_menu |
806 | +#: view:product.feature:0 |
807 | +#: view:product.product:0 |
808 | +#: field:product.product,feature_ids:0 |
809 | +msgid "Features" |
810 | +msgstr "Caracteristicas" |
811 | + |
812 | +#. module: account_analytic_analysis_rent |
813 | +#: view:lines.create:0 |
814 | +msgid "Do you want to show details of work in invoice ?" |
815 | +msgstr "Mostrar los detalles del trabajo en la factura ?" |
816 | + |
817 | +#. module: account_analytic_analysis_rent |
818 | +#: field:lines.create,period_id:0 |
819 | +msgid "Period" |
820 | +msgstr "Periodo" |
821 | + |
822 | +#. module: account_analytic_analysis_rent |
823 | +#: report:account.analytic.account.report:0 |
824 | +msgid "Firma Responsable:" |
825 | +msgstr "Firma Responsable:" |
826 | + |
827 | +#. module: account_analytic_analysis_rent |
828 | +#: constraint:account.analytic.line:0 |
829 | +msgid "You can not create analytic line on view account." |
830 | +msgstr "No puede crear una línea analítica en una cuenta vista" |
831 | + |
832 | +#. module: account_analytic_analysis_rent |
833 | +#: view:account.analytic.account:0 |
834 | +#: field:account.analytic.account,invoice_ids:0 |
835 | +msgid "Invoice" |
836 | +msgstr "Factura" |
837 | + |
838 | +#. module: account_analytic_analysis_rent |
839 | +#: view:lines.create:0 |
840 | +msgid "Cancel" |
841 | +msgstr "Cancelar" |
842 | + |
843 | +#. module: account_analytic_analysis_rent |
844 | +#: sql_constraint:product.product:0 |
845 | +msgid "The code of Product must be unique !" |
846 | +msgstr "El codigo del producto debe ser unico !" |
847 | + |
848 | +#. module: account_analytic_analysis_rent |
849 | +#: view:lines.create:0 |
850 | +msgid "Analytic Entries" |
851 | +msgstr "Poliza Analítica" |
852 | + |
853 | +#. module: account_analytic_analysis_rent |
854 | +#: report:account.analytic.account.report:0 |
855 | +msgid "Responsable:" |
856 | +msgstr "Responsable:" |
857 | + |
858 | +#. module: account_analytic_analysis_rent |
859 | +#: view:lines.create:0 |
860 | +msgid "Billing Data" |
861 | +msgstr "Datos de Factura" |
862 | + |
863 | +#. module: account_analytic_analysis_rent |
864 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:66 |
865 | +#, python-format |
866 | +msgid "Please fill in the Partner or Customer and Sale Pricelist fields in the Analytic Account:\n" |
867 | +"%s" |
868 | +msgstr "Por favor llene en el Proveedor o Cliente y la lista de precios en la cuenta analítica:\n" |
869 | +"%s" |
870 | + |
871 | +#. module: account_analytic_analysis_rent |
872 | +#: field:account.analytic.line,feature_id:0 |
873 | +#: field:product.feature.line,name:0 |
874 | +msgid "Feature" |
875 | +msgstr "Caracteristica" |
876 | + |
877 | +#. module: account_analytic_analysis_rent |
878 | +#: model:ir.model,name:account_analytic_analysis_rent.model_product_feature_line |
879 | +msgid "product.feature.line" |
880 | +msgstr "product.feature.line" |
881 | + |
882 | +#. module: account_analytic_analysis_rent |
883 | +#: model:ir.actions.act_window,name:account_analytic_analysis_rent.lines_invoice_create |
884 | +#: model:ir.actions.act_window,name:account_analytic_analysis_rent.lines_invoice_create_wizard |
885 | +#: view:lines.create:0 |
886 | +msgid "Create Invoice" |
887 | +msgstr "Crear factura" |
888 | + |
889 | +#. module: account_analytic_analysis_rent |
890 | +#: code:addons/account_analytic_analysis_rent/wizard/lines_invoice_create.py:108 |
891 | +#, python-format |
892 | +msgid "At least one line has no product !" |
893 | +msgstr "Al menos una linea no tiene producto !" |
894 | + |
895 | +#. module: account_analytic_analysis_rent |
896 | +#: report:account.analytic.account.report:0 |
897 | +msgid "liente:" |
898 | +msgstr "liente:" |
899 | + |
900 | +#. module: account_analytic_analysis_rent |
901 | +#: view:account.analytic.account:0 |
902 | +#: field:account.analytic.product,product_id:0 |
903 | +#: model:ir.model,name:account_analytic_analysis_rent.model_product_product |
904 | +#: field:product.feature.line,analytic_id:0 |
905 | +#: field:product.feature.line,product_id:0 |
906 | +#: field:product.feature.line,product_line_id:0 |
907 | +msgid "Product" |
908 | +msgstr "Producto" |
909 | + |
910 | +#. module: account_analytic_analysis_rent |
911 | +#: view:lines.create:0 |
912 | +msgid "Total Quantity" |
913 | +msgstr "Cantidad Total" |
914 | + |
915 | +#. module: account_analytic_analysis_rent |
916 | +#: field:res.company,img_report:0 |
917 | +msgid "Imagen Contratos" |
918 | +msgstr "Imagen Contratos" |
919 | + |
920 | +#. module: account_analytic_analysis_rent |
921 | +#: field:product.feature,description:0 |
922 | +msgid "Description" |
923 | +msgstr "Descripcion" |
924 | + |
925 | +#. module: account_analytic_analysis_rent |
926 | +#: field:account.analytic.product,type:0 |
927 | +msgid "Type" |
928 | +msgstr "Tipo" |
929 | + |
930 | +#. module: account_analytic_analysis_rent |
931 | +#: field:account.analytic.account,journal_id:0 |
932 | +msgid "Journal" |
933 | +msgstr "Diario" |
934 | + |
935 | +#. module: account_analytic_analysis_rent |
936 | +#: selection:account.analytic.product,type:0 |
937 | +#: field:product.template,accesory_ok:0 |
938 | +msgid "Accesory" |
939 | +msgstr "Accesorio" |
940 | + |
941 | +#. module: account_analytic_analysis_rent |
942 | +#: field:account.analytic.product,analytic_id:0 |
943 | +msgid "Account Analytic" |
944 | +msgstr "Cuenta Analitica" |
945 | + |
946 | +#. module: account_analytic_analysis_rent |
947 | +#: report:account.analytic.account.report:0 |
948 | +msgid "Dirección:" |
949 | +msgstr "Dirección:" |
950 | + |
951 | +#. module: account_analytic_analysis_rent |
952 | +#: field:lines.create,date_end:0 |
953 | +msgid "End Date" |
954 | +msgstr "Fecha Final" |
955 | + |
956 | +#. module: account_analytic_analysis_rent |
957 | +#: sql_constraint:res.company:0 |
958 | +msgid "The company name must be unique !" |
959 | +msgstr "¡El nombre de la compañía debe ser único!" |
960 | + |
961 | +#. module: account_analytic_analysis_rent |
962 | +#: field:product.feature,name:0 |
963 | +msgid "Name" |
964 | +msgstr "Nombre" |
965 | + |
966 | +#. module: account_analytic_analysis_rent |
967 | +#: model:ir.model,name:account_analytic_analysis_rent.model_lines_create |
968 | +msgid "lines.create" |
969 | +msgstr "lines.create" |
970 | + |
971 | +#. module: account_analytic_analysis_rent |
972 | +#: report:account.analytic.account.report:0 |
973 | +msgid "Fecha Final:" |
974 | +msgstr "Fecha Final:" |
975 | + |
976 | +#. module: account_analytic_analysis_rent |
977 | +#: model:ir.model,name:account_analytic_analysis_rent.model_product_feature |
978 | +msgid "product.feature" |
979 | +msgstr "product.feature" |
980 | + |
981 | +#. module: account_analytic_analysis_rent |
982 | +#: model:ir.model,name:account_analytic_analysis_rent.model_product_template |
983 | +msgid "Product Template" |
984 | +msgstr "Plantilla de producto" |
985 | + |
986 | +#. module: account_analytic_analysis_rent |
987 | +#: view:account.analytic.account:0 |
988 | +#: field:account.analytic.account,voucher_ids:0 |
989 | +msgid "Payments" |
990 | +msgstr "Pagos" |
991 | + |
992 | +#. module: account_analytic_analysis_rent |
993 | +#: report:account.analytic.account.report:0 |
994 | +msgid "a:" |
995 | +msgstr "a:" |
996 | + |
997 | +#. module: account_analytic_analysis_rent |
998 | +#: code:addons/account_analytic_analysis_rent/account_analytic_account_rent.py:87 |
999 | +#, python-format |
1000 | +msgid "You cannot modify an invoiced analytic lines!" |
1001 | +msgstr "No se pueden modificar una linea analítica facturada!" |
1002 | + |
1003 | +#. module: account_analytic_analysis_rent |
1004 | +#: field:lines.create,line_ids:0 |
1005 | +msgid "lines" |
1006 | +msgstr "lineas" |
1007 | + |
1008 | +#. module: account_analytic_analysis_rent |
1009 | +#: constraint:product.product:0 |
1010 | +msgid "Error: Invalid ean code" |
1011 | +msgstr "Error: Código EAN erróneo" |
1012 | + |
1013 | +#. module: account_analytic_analysis_rent |
1014 | +#: selection:account.analytic.product,type:0 |
1015 | +#: view:product.product:0 |
1016 | +#: field:product.template,rent:0 |
1017 | +msgid "Rent" |
1018 | +msgstr "Renta" |
1019 | + |
1020 | +#. module: account_analytic_analysis_rent |
1021 | +#: field:account.analytic.account,product_ids:0 |
1022 | +msgid "Products" |
1023 | +msgstr "Productos" |
1024 | + |
1025 | +#. module: account_analytic_analysis_rent |
1026 | +#: view:lines.create:0 |
1027 | +msgid "Total" |
1028 | +msgstr "Total" |
1029 | + |
1030 | |
1031 | === modified file 'account_analytic_analysis_rent/product.py' |
1032 | --- account_analytic_analysis_rent/product.py 2013-06-03 17:04:02 +0000 |
1033 | +++ account_analytic_analysis_rent/product.py 2014-02-15 01:21:30 +0000 |
1034 | @@ -22,15 +22,54 @@ |
1035 | from openerp.osv import osv, fields |
1036 | from datetime import datetime, timedelta |
1037 | from tools.translate import _ |
1038 | +import decimal_precision as dp |
1039 | |
1040 | class product_template(osv.osv): |
1041 | _inherit='product.template' |
1042 | |
1043 | + |
1044 | + |
1045 | _columns={ |
1046 | 'rent_ok':fields.boolean('Rentable'), |
1047 | + 'accesory_ok':fields.boolean('Accesory'), |
1048 | 'rent': fields.boolean('Rent', readonly=True), |
1049 | - 'contract_id': fields.many2one('account.analytic.account', 'Contract', readonly=True) |
1050 | + 'contract_id': fields.many2one('account.analytic.account', 'Contract', readonly=True), |
1051 | } |
1052 | |
1053 | product_template() |
1054 | - |
1055 | + |
1056 | +class product_product(osv.osv): |
1057 | + _inherit='product.product' |
1058 | + |
1059 | + _columns={ |
1060 | + 'feature_ids': fields.one2many('product.feature.line', 'product_id', 'Features') |
1061 | + } |
1062 | + |
1063 | +product_product() |
1064 | + |
1065 | +class product_feature(osv.osv): |
1066 | + _name='product.feature' |
1067 | + |
1068 | + _columns={ |
1069 | + 'name':fields.char('Name', size=64, required=True), |
1070 | + 'description':fields.char('Description', size=256), |
1071 | + } |
1072 | + |
1073 | +product_feature() |
1074 | + |
1075 | +class product_feature_line(osv.osv): |
1076 | + _name='product.feature.line' |
1077 | + _order='product_id' |
1078 | + _columns={ |
1079 | + 'name':fields.many2one('product.feature', 'Feature', required=True), |
1080 | + 'product_id':fields.many2one('product.product','Product'), |
1081 | + 'product_line_id':fields.many2one('product.product','Product'), |
1082 | + 'counter':fields.integer('Counter'), |
1083 | + 'analytic_id':fields.many2one('account.analytic.account','Product'), |
1084 | + 'cost':fields.float('cost', digits_compute=dp.get_precision('Account')), |
1085 | + 'prodlot_feature_id': fields.many2one('stock.production.lot', 'Production Lot', help="Production lot is used to put a serial number on the production", select=True), |
1086 | + } |
1087 | + |
1088 | +product_feature_line() |
1089 | + |
1090 | + |
1091 | |
1092 | === modified file 'account_analytic_analysis_rent/product_view.xml' |
1093 | --- account_analytic_analysis_rent/product_view.xml 2013-06-03 17:04:02 +0000 |
1094 | +++ account_analytic_analysis_rent/product_view.xml 2014-02-15 01:21:30 +0000 |
1095 | @@ -3,19 +3,42 @@ |
1096 | <data> |
1097 | |
1098 | <record model="ir.ui.view" id="product_rentable"> |
1099 | - <field name="name">product_rentable</field> |
1100 | + <field name="name">product.rentable</field> |
1101 | <field name="model">product.product</field> |
1102 | <field name="type">form</field> |
1103 | <field name="inherit_id" ref="product.product_normal_form_view"/> |
1104 | <field name="arch" type="xml"> |
1105 | <field name="purchase_ok" position="after"> |
1106 | <field name="rent_ok"/> |
1107 | + <field name="accesory_ok"/> |
1108 | </field> |
1109 | </field> |
1110 | </record> |
1111 | |
1112 | + <record model="ir.ui.view" id="product_feature_product"> |
1113 | + <field name="name">product.feature.product</field> |
1114 | + <field name="model">product.product</field> |
1115 | + <field name="type">form</field> |
1116 | + <field name="inherit_id" ref="product.product_normal_form_view"/> |
1117 | + <field name="arch" type="xml"> |
1118 | + <group name="misc" position="after"> |
1119 | + <group name="Features" colspan="2"> |
1120 | + <separator colspan="4" string='Features'/> |
1121 | + <field name="feature_ids" nolabel="1"> |
1122 | + <tree string='Features'> |
1123 | + <field name="name"/> |
1124 | + </tree> |
1125 | + <form string='Features'> |
1126 | + <field name="name"/> |
1127 | + </form> |
1128 | + </field> |
1129 | + </group> |
1130 | + </group> |
1131 | + </field> |
1132 | + </record> |
1133 | + |
1134 | <record model="ir.ui.view" id="product_rent"> |
1135 | - <field name="name">product_rent</field> |
1136 | + <field name="name">product.rent</field> |
1137 | <field name="model">product.product</field> |
1138 | <field name="type">form</field> |
1139 | <field name="inherit_id" ref="product.product_normal_form_view"/> |
1140 | @@ -49,5 +72,48 @@ |
1141 | |
1142 | <menuitem action="product_rent_action" id="product_rent_action_menu" parent="base.menu_sales"/> |
1143 | |
1144 | + <record model="ir.actions.act_window" id="product_accesory_action"> |
1145 | + <field name="name">Accesory Product</field> |
1146 | + <field name="res_model">product.product</field> |
1147 | + <field name="view_type">form</field> |
1148 | + <field name="view_mode">tree,form</field> |
1149 | + <field name="domain">[('accesory_ok','=',True)]</field> |
1150 | + </record> |
1151 | + |
1152 | + <menuitem action="product_accesory_action" id="product_accesory_action_menu" parent="base.menu_sales"/> |
1153 | + |
1154 | + <record id="view_feature_product_tree" model="ir.ui.view"> |
1155 | + <field name="name">view.feature.product.tree</field> |
1156 | + <field name="model">product.feature</field> |
1157 | + <field name="type">tree</field> |
1158 | + <field name="arch" type="xml"> |
1159 | + <tree string="Features"> |
1160 | + <field name="name"/> |
1161 | + <field name="description"/> |
1162 | + </tree> |
1163 | + </field> |
1164 | + </record> |
1165 | + |
1166 | + <record id="view_feature_product_form" model="ir.ui.view"> |
1167 | + <field name="name">view.feature.product.form</field> |
1168 | + <field name="model">product.feature</field> |
1169 | + <field name="type">form</field> |
1170 | + <field name="arch" type="xml"> |
1171 | + <form string="Features"> |
1172 | + <field name="name"/> |
1173 | + <field name="description"/> |
1174 | + </form> |
1175 | + </field> |
1176 | + </record> |
1177 | + |
1178 | + <record model="ir.actions.act_window" id="product_feature_action"> |
1179 | + <field name="name">Features</field> |
1180 | + <field name="res_model">product.feature</field> |
1181 | + <field name="view_type">form</field> |
1182 | + <field name="view_mode">tree,form</field> |
1183 | + </record> |
1184 | + <menuitem id="product_feature" name="Features" parent="base.menu_sale_config_sales"/> |
1185 | + <menuitem action="product_feature_action" id="product_feature_action_menu" parent="product_feature"/> |
1186 | + |
1187 | </data> |
1188 | </openerp> |
1189 | |
1190 | === added directory 'account_analytic_analysis_rent/wizard' |
1191 | === added file 'account_analytic_analysis_rent/wizard/__init__.py' |
1192 | --- account_analytic_analysis_rent/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
1193 | +++ account_analytic_analysis_rent/wizard/__init__.py 2014-02-15 01:21:30 +0000 |
1194 | @@ -0,0 +1,1 @@ |
1195 | +import lines_invoice_create |
1196 | |
1197 | === added file 'account_analytic_analysis_rent/wizard/lines_invoice_create.py' |
1198 | --- account_analytic_analysis_rent/wizard/lines_invoice_create.py 1970-01-01 00:00:00 +0000 |
1199 | +++ account_analytic_analysis_rent/wizard/lines_invoice_create.py 2014-02-15 01:21:30 +0000 |
1200 | @@ -0,0 +1,259 @@ |
1201 | +# -*- coding: utf-8 -*- |
1202 | +############################################################################## |
1203 | +# |
1204 | +# OpenERP, Open Source Management Solution |
1205 | +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
1206 | +# |
1207 | +# This program is free software: you can redistribute it and/or modify |
1208 | +# it under the terms of the GNU Affero General Public License as |
1209 | +# published by the Free Software Foundation, either version 3 of the |
1210 | +# License, or (at your option) any later version. |
1211 | +# |
1212 | +# This program is distributed in the hope that it will be useful, |
1213 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1214 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1215 | +# GNU Affero General Public License for more details. |
1216 | +# |
1217 | +# You should have received a copy of the GNU Affero General Public License |
1218 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1219 | +# |
1220 | +############################################################################## |
1221 | + |
1222 | +import time |
1223 | +from datetime import datetime |
1224 | +from osv import osv, fields |
1225 | +from tools.translate import _ |
1226 | + |
1227 | +## Create an invoice based on selected timesheet lines |
1228 | +# |
1229 | + |
1230 | +class account_analytic_line(osv.osv): |
1231 | + _inherit = "account.analytic.line" |
1232 | + |
1233 | + # |
1234 | + # data = { |
1235 | + # 'date': boolean |
1236 | + # 'time': boolean |
1237 | + # 'name': boolean |
1238 | + # 'price': boolean |
1239 | + # 'product': many2one id |
1240 | + # } |
1241 | + def invoice_cost_create(self, cr, uid, ids, data={}, context=None): |
1242 | + analytic_account_obj = self.pool.get('account.analytic.account') |
1243 | + res_partner_obj = self.pool.get('res.partner') |
1244 | + account_payment_term_obj = self.pool.get('account.payment.term') |
1245 | + invoice_obj = self.pool.get('account.invoice') |
1246 | + product_obj = self.pool.get('product.product') |
1247 | + invoice_factor_obj = self.pool.get('hr_timesheet_invoice.factor') |
1248 | + pro_price_obj = self.pool.get('product.pricelist') |
1249 | + fiscal_pos_obj = self.pool.get('account.fiscal.position') |
1250 | + product_uom_obj = self.pool.get('product.uom') |
1251 | + invoice_line_obj = self.pool.get('account.invoice.line') |
1252 | + feature_line_obj = self.pool.get('product.feature.line') |
1253 | + invoices = [] |
1254 | + if context is None: |
1255 | + context = {} |
1256 | + |
1257 | + account_ids = {} |
1258 | + for line in self.pool.get('account.analytic.line').browse(cr, uid, ids, context=context): |
1259 | + account_ids[line.account_id.id] = True |
1260 | + |
1261 | + account_ids = account_ids.keys() #data['accounts'] |
1262 | + for account in analytic_account_obj.browse(cr, uid, account_ids, context=context): |
1263 | + partner = account.partner_id |
1264 | + if (not partner) or not (account.pricelist_id): |
1265 | + raise osv.except_osv(_('Analytic Account incomplete'), |
1266 | + _('Please fill in the Partner or Customer and Sale Pricelist fields in the Analytic Account:\n%s') % (account.name,)) |
1267 | + |
1268 | + if not partner.address: |
1269 | + raise osv.except_osv(_('Partner incomplete'), |
1270 | + _('Please fill in the Address field in the Partner: %s.') % (partner.name,)) |
1271 | + |
1272 | + date_due = False |
1273 | + if partner.property_payment_term: |
1274 | + pterm_list= account_payment_term_obj.compute(cr, uid, |
1275 | + partner.property_payment_term.id, value=1, |
1276 | + date_ref=time.strftime('%Y-%m-%d')) |
1277 | + if pterm_list: |
1278 | + pterm_list = [line[0] for line in pterm_list] |
1279 | + pterm_list.sort() |
1280 | + date_due = pterm_list[-1] |
1281 | + curr_invoice = { |
1282 | + 'name': time.strftime('%d/%m/%Y')+' - '+account.name, |
1283 | + 'partner_id': account.partner_id.id, |
1284 | + 'address_contact_id': res_partner_obj.address_get(cr, uid, |
1285 | + [account.partner_id.id], adr_pref=['contact'])['contact'], |
1286 | + 'address_invoice_id': res_partner_obj.address_get(cr, uid, |
1287 | + [account.partner_id.id], adr_pref=['invoice'])['invoice'], |
1288 | + 'payment_term': partner.property_payment_term.id or False, |
1289 | + 'account_id': partner.property_account_receivable.id, |
1290 | + 'currency_id': account.pricelist_id.currency_id.id, |
1291 | + 'date_due': date_due, |
1292 | + 'fiscal_position': account.partner_id.property_account_position.id, |
1293 | + 'type':'out_invoice', |
1294 | + 'journal_id':account.journal_id.id |
1295 | + } |
1296 | + last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context) |
1297 | + invoices.append(last_invoice) |
1298 | + context2 = context.copy() |
1299 | + context2['lang'] = partner.lang |
1300 | + cr.execute("SELECT product_id, to_invoice, unit_amount, product_uom_id, w_start, w_end, name, amount, feature_id, prodlot_id " \ |
1301 | + "FROM account_analytic_line as line " \ |
1302 | + "WHERE account_id = %s " \ |
1303 | + "AND id IN %s AND to_invoice IS NOT NULL " , (account.id, tuple(ids),)) |
1304 | + |
1305 | + for product_id, factor_id, qty, uom, w_start, w_end, name, amount, feature_id, prodlot_id in cr.fetchall(): |
1306 | + product = product_obj.browse(cr, uid, product_id, context2) |
1307 | + if not product: |
1308 | + raise osv.except_osv(_('Error'), _('At least one line has no product !')) |
1309 | + factor_name = '' |
1310 | + factor = invoice_factor_obj.browse(cr, uid, factor_id, context2) |
1311 | + |
1312 | + ctx = context.copy() |
1313 | + ctx.update({'uom':uom}) |
1314 | + if account.pricelist_id: |
1315 | + pl = account.pricelist_id.id |
1316 | + price = pro_price_obj.price_get(cr,uid,[pl], product_id or data.get('product', False), qty or 1.0, account.partner_id.id, context=ctx)[pl] |
1317 | + else: |
1318 | + price = 0.0 |
1319 | + |
1320 | + taxes = product.taxes_id |
1321 | + tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes) |
1322 | + account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id |
1323 | + if not account_id: |
1324 | + raise osv.except_osv(_("Configuration Error"), _("No income account defined for product '%s'") % product.name) |
1325 | + curr_line = { |
1326 | + 'price_unit': amount or price, |
1327 | + 'quantity': qty, |
1328 | + 'discount':factor.factor, |
1329 | + 'invoice_line_tax_id': [(6,0,tax )], |
1330 | + 'invoice_id': last_invoice, |
1331 | + 'name': name, |
1332 | + 'product_id': product_id or data.get('product',product_id), |
1333 | + 'invoice_line_tax_id': [(6,0,tax)], |
1334 | + 'uos_id': uom, |
1335 | + 'account_id': account_id, |
1336 | + 'account_analytic_id': account.id, |
1337 | + 'w_start': int(w_start or 0), |
1338 | + 'w_end': int(w_end or 0), |
1339 | + 'prodlot_id': prodlot_id, |
1340 | + } |
1341 | + feature_line_obj.write(cr, uid, feature_id, {'counter': int(w_end or 0)}, context=context) |
1342 | + # |
1343 | + # Compute for lines |
1344 | + # |
1345 | + cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id IN %s AND product_id=%s and to_invoice=%s ORDER BY account_analytic_line.date", (account.id, tuple(ids), product_id, factor_id)) |
1346 | + |
1347 | + line_ids = cr.dictfetchall() |
1348 | + note = [] |
1349 | + for line in line_ids: |
1350 | + # set invoice_line_note |
1351 | + details = [] |
1352 | + if data.get('date', False): |
1353 | + details.append(line['date']) |
1354 | + if data.get('time', False): |
1355 | + if line['product_uom_id']: |
1356 | + details.append("%s %s" % (line['unit_amount'], product_uom_obj.browse(cr, uid, [line['product_uom_id']],context2)[0].name)) |
1357 | + else: |
1358 | + details.append("%s" % (line['unit_amount'], )) |
1359 | + if data.get('name', False): |
1360 | + details.append(line['name']) |
1361 | + note.append(u' - '.join(map(lambda x: unicode(x) or '',details))) |
1362 | + |
1363 | + curr_line['note'] = "\n".join(map(lambda x: unicode(x) or '',note)) |
1364 | + invoice_line_obj.create(cr, uid, curr_line, context=context) |
1365 | + cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id IN %s", (last_invoice, account.id, tuple(ids))) |
1366 | + |
1367 | + invoice_obj.button_reset_taxes(cr, uid, [last_invoice], context) |
1368 | + return invoices |
1369 | + |
1370 | +class lines_create(osv.osv_memory): |
1371 | + |
1372 | + _name = 'lines.create' |
1373 | + _columns = { |
1374 | + 'period_id': fields.many2one('account.period', 'Period', required=True), |
1375 | + 'line_ids': fields.many2many('account.analytic.line','analytic_wiz_lines_rel','wiz_id','line_id','lines'), |
1376 | + 'contract_id': fields.many2one('account.analytic.account','Contract'), |
1377 | + 'date_start': fields.date('Start Date'), |
1378 | + 'date_end': fields.date('End Date'), |
1379 | + } |
1380 | + |
1381 | + def default_get(self, cr, uid, fields, context=None): |
1382 | + if context is None: |
1383 | + context = {} |
1384 | + res = super(lines_create, self).default_get( |
1385 | + cr, uid, fields, context=context) |
1386 | + analytic_obj = self.pool.get('account.analytic.account') |
1387 | + period_obj = self.pool.get('account.period') |
1388 | + lines_ids=[] |
1389 | + if context.get('active_model') == 'account.analytic.account': |
1390 | + res['contract_id'] = context.get('active_id') |
1391 | + date = datetime.strptime(datetime.now().strftime('%Y-%m-%d'), "%Y-%m-%d") |
1392 | + period = period_obj.find(cr, uid, date, context=context) |
1393 | + if period: |
1394 | + res['period_id'] = period[0] or False |
1395 | + for contract in analytic_obj.browse(cr,uid,context['active_ids'],context): |
1396 | + res['date_start'] = contract.date_start |
1397 | + res['date_end'] = contract.date |
1398 | + lines_ids=[] |
1399 | + for line in contract.line_ids: |
1400 | + if not line.invoice_id and line.to_invoice: |
1401 | + period_br = period_obj.browse(cr, uid, res['period_id'], context=context) |
1402 | + if line.date >= period_br.date_start and line.date <= period_br.date_stop: |
1403 | + lines_ids.append(line.id) |
1404 | + res['line_ids']=lines_ids |
1405 | + return res |
1406 | + |
1407 | + def onchange_date(self, cr, uid, ids, period_id, contract_id, context=None): |
1408 | + if context is None: |
1409 | + context = {} |
1410 | + res={} |
1411 | + analytic_obj = self.pool.get('account.analytic.account') |
1412 | + period_obj = self.pool.get('account.period') |
1413 | + lines_ids=[] |
1414 | + if period_id: |
1415 | + for contract in analytic_obj.browse(cr,uid,[contract_id],context): |
1416 | + lines_ids=[] |
1417 | + for line in contract.line_ids: |
1418 | + if not line.invoice_id and line.to_invoice: |
1419 | + period_br = period_obj.browse(cr, uid, period_id, context=context) |
1420 | + if line.date >= period_br.date_start and line.date <= period_br.date_stop: |
1421 | + lines_ids.append(line.id) |
1422 | + res['value']={'line_ids':lines_ids} |
1423 | + return res |
1424 | + |
1425 | + def do_create(self, cr, uid, ids, context=None): |
1426 | + if context is None: |
1427 | + context = {} |
1428 | + analytic_obj = self.pool.get('account.analytic.account') |
1429 | + data = self.browse(cr, uid, ids, context=context)[0] |
1430 | + contract = data.contract_id |
1431 | + invs = [] |
1432 | + new_lines = [] |
1433 | + for prod in contract.product_ids: |
1434 | + lines_ids=[] |
1435 | + for line in data.line_ids: |
1436 | + if not line.invoice_id and line.to_invoice and line.product_id.id==prod.product_id.id and prod.type=='rent': |
1437 | + lines_ids.append(line.id) |
1438 | + if not lines_ids and prod.type=='rent': |
1439 | + raise osv.except_osv(_('Warning !'), _("Invoice is already linked to some of the analytic line(s)!")) |
1440 | + if contract.group_product and prod.type=='rent': |
1441 | + new_lines = new_lines + lines_ids |
1442 | + elif not contract.group_product and prod.type=='rent': |
1443 | + invs.append(self.pool.get('account.analytic.line').invoice_cost_create(cr, uid, lines_ids, {}, context=context)) |
1444 | + if contract.group_product: |
1445 | + invs.append(self.pool.get('account.analytic.line').invoice_cost_create(cr, uid, new_lines, {}, context=context)) |
1446 | + mod_obj = self.pool.get('ir.model.data') |
1447 | + act_obj = self.pool.get('ir.actions.act_window') |
1448 | + mod_ids = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')], context=context)[0] |
1449 | + res_id = mod_obj.read(cr, uid, mod_ids, ['res_id'], context=context)['res_id'] |
1450 | + act_win = act_obj.read(cr, uid, res_id, [], context=context) |
1451 | + act_win['domain'] = [('id','in',invs),('type','=','out_invoice')] |
1452 | + act_win['name'] = _('Invoices') |
1453 | + return act_win |
1454 | + |
1455 | + |
1456 | +lines_create() |
1457 | + |
1458 | + |
1459 | + |
1460 | |
1461 | === added file 'account_analytic_analysis_rent/wizard/lines_invoice_create_view.xml' |
1462 | --- account_analytic_analysis_rent/wizard/lines_invoice_create_view.xml 1970-01-01 00:00:00 +0000 |
1463 | +++ account_analytic_analysis_rent/wizard/lines_invoice_create_view.xml 2014-02-15 01:21:30 +0000 |
1464 | @@ -0,0 +1,68 @@ |
1465 | +<?xml version="1.0" encoding="utf-8"?> |
1466 | +<openerp> |
1467 | + <data> |
1468 | + |
1469 | + <record id="view_lines_create" model="ir.ui.view"> |
1470 | + <field name="name">lines.create.form</field> |
1471 | + <field name="model">lines.create</field> |
1472 | + <field name="type">form</field> |
1473 | + <field name="arch" type="xml"> |
1474 | + <form string="Create Invoice"> |
1475 | + <notebook colspan="4"> |
1476 | + <page string="Billing Data"> |
1477 | + <group col="4" colspan="4"> |
1478 | + <separator string="Do you want to show details of work in invoice ?" colspan="4"/> |
1479 | + <field name="date_start" invisible="1"/> |
1480 | + <field name="date_end" invisible="1"/> |
1481 | + <field name="period_id" on_change="onchange_date(period_id,contract_id)" domain="[('date_start', '>=', date_start), ('date_stop', '<=', date_end)]"/> |
1482 | + <newline/> |
1483 | + <field name="line_ids" nolabel="1" colspan="4"> |
1484 | + <tree editable="top" string="Analytic Entries"> |
1485 | + <field name="date" /> |
1486 | + <field name="ref" /> |
1487 | + <field name="name" /> |
1488 | + <field name="journal_id" /> |
1489 | + <field name="amount" sum="Total" /> |
1490 | + <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" /> |
1491 | + <field name="prodlot_id"/> |
1492 | + <field name="w_start" on_change="onchange_copys(w_start,w_end)"/> |
1493 | + <field name="w_end" on_change="onchange_copys(w_start,w_end)" /> |
1494 | + <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" /> |
1495 | + <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" /> |
1496 | + <field name="general_account_id" /> |
1497 | + <field name="user_id" invisible="1"/> |
1498 | + |
1499 | + </tree> |
1500 | + </field> |
1501 | + <field name="contract_id" invisible="1"/> |
1502 | + </group> |
1503 | + </page> |
1504 | + </notebook> |
1505 | + <separator colspan="4"/> |
1506 | + <group col="2" colspan="4"> |
1507 | + <button special="cancel" string="Cancel" icon='gtk-cancel'/> |
1508 | + <button name="do_create" string="Create Invoices" colspan="1" type="object" icon="terp-gtk-go-back-rtl"/> |
1509 | + </group> |
1510 | + </form> |
1511 | + </field> |
1512 | + </record> |
1513 | + |
1514 | + <record id="lines_invoice_create" model="ir.actions.act_window"> |
1515 | + <field name="name">Create Invoice</field> |
1516 | + <field name="type">ir.actions.act_window</field> |
1517 | + <field name="res_model">lines.create</field> |
1518 | + <field name="view_type">form</field> |
1519 | + <field name="view_mode">form</field> |
1520 | + <field name="target">new</field> |
1521 | + </record> |
1522 | + |
1523 | + <act_window id="lines_invoice_create_wizard" |
1524 | + name="Create Invoice" |
1525 | + src_model="account.analytic.account" |
1526 | + res_model="lines.create" |
1527 | + view_mode="form" |
1528 | + target="new" |
1529 | + key2="client_action_multi"/> |
1530 | + |
1531 | + </data> |
1532 | +</openerp> |