Merge lp:~nicolariolini/micronaet-fashion/nicola into lp:micronaet-fashion

Proposed by Nicola Riolini - Micronaet
Status: Merged
Approved by: Anna Micronaet
Approved revision: 303
Merged at revision: 132
Proposed branch: lp:~nicolariolini/micronaet-fashion/nicola
Merge into: lp:micronaet-fashion
Diff against target: 2654 lines (+1197/-465) (has conflicts)
11 files modified
fashion/__openerp__.py (+12/-10)
fashion/errata_corrige.py (+82/-1)
fashion/etl/errata_corrige.py (+12/-1)
fashion/etl/import.py (+260/-0)
fashion/fashion.py (+395/-197)
fashion/fashion_view.xml (+148/-115)
fashion/i18n/it.po (+257/-113)
fashion/security/ir.model.access.csv (+2/-2)
fashion/wizard/duplication_fashion.py (+26/-23)
fashion/wizard/report_wizard.py (+2/-2)
fashion/wizard/report_wizard.xml (+1/-1)
Contents conflict in fashion/report/form_B.odt
To merge this branch: bzr merge lp:~nicolariolini/micronaet-fashion/nicola
Reviewer Review Type Date Requested Status
Micronaet s.r.l. Pending
Review via email: mp+234997@code.launchpad.net
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 'fashion/__openerp__.py'
2--- fashion/__openerp__.py 2014-03-13 17:26:45 +0000
3+++ fashion/__openerp__.py 2014-09-17 15:12:42 +0000
4@@ -37,16 +37,18 @@
5 'author': 'Micronaet s.r.l.',
6 'website': 'http://www.micronaet.it',
7 'license': 'AGPL-3',
8- 'depends': ['base',
9- 'product',
10- 'knowledge',
11- 'report_aeroo',
12- 'report_aeroo_ooo',
13- 'l10n_it',
14- 'fashion-kanban',
15- 'fashion_sheet_wide',
16- 'web_washing_symbol',
17- ],
18+ 'depends': [
19+ 'base',
20+ 'product',
21+ 'knowledge',
22+ 'report_aeroo',
23+ 'report_aeroo_ooo',
24+ 'l10n_it',
25+ 'fashion-kanban',
26+ 'fashion_sheet_wide',
27+ 'web_washing_symbol',
28+ 'web_m2x_options', # lock create in m2o
29+ ],
30 'init_xml': [],
31 'demo_xml': [],
32 'data': [
33
34=== modified file 'fashion/errata_corrige.py'
35--- fashion/errata_corrige.py 2014-09-17 14:31:39 +0000
36+++ fashion/errata_corrige.py 2014-09-17 15:12:42 +0000
37@@ -286,5 +286,86 @@
38 print "[INFO] %s record updated" % (i)
39 self.create_update_header(cr, uid, [form.id], context=context)
40 return True
41-
42+
43+ def set_colors(self, cr, uid, context=None):
44+ ''' Read files with price in rel and update only price
45+ '''
46+ print "Start import fashion.form.accessory.rel"
47+ file_input = os.path.expanduser('~/etl/fashion/SchXacc.txt')
48+ separator = '\t'
49+ lines = csv.reader(open(file_input,'rU'),delimiter=separator)
50+ max_col = False
51+ tot = 0
52+ accessory_pool = self.pool.get('fashion.form.accessory.rel')
53+ try:
54+ for line in lines:
55+ tot += 1
56+ if not max_col:
57+ max_col = len(line)
58+
59+ if len(line)!=max_col:
60+ print "[ERROR]", tot, "Column error! "
61+ continue
62+
63+ access_id = line[0]
64+ note = Prepare(line[8]) # colore
65+ if not note:
66+ continue
67+
68+ accessory_ids = accessory_pool.search(cr, uid, [('access_id', '=', access_id)], context=context)
69+ if not accessory_ids or not note:
70+ continue
71+
72+ if len(accessory_ids) != 1:
73+ print "Errore accessory must be 1"
74+ continue
75+
76+ accessory_pool.write(cr, uid, accessory_ids[0], {
77+ 'note': note,
78+ }, context=context)
79+
80+ print "[INFO] Line %s Update %s Note/Colore: %s!" % (tot, access_id, note)
81+ except:
82+ print '[ERROR] Error importing data!'
83+ return True
84+
85+ def explode_model(self, cr, uid, context=None):
86+ ''' Explode all model correctly
87+ '''
88+ print "Start exploding model in part of code"
89+ form_ids = self.search(cr, uid, [], context=context)
90+ i = 0
91+ for item in self.browse(cr, uid, form_ids, context=context):
92+ i += 1
93+ if i % 100 == 0:
94+ print "Record aggiornati: %s" % (i)
95+
96+ # Force rewrite of model for raise write recalculatin of explosion:
97+ self.write(cr, uid, [item.id], {
98+ 'model': item.model}, context=context)
99+ return True
100+
101+ def explode_model_partner(self, cr, uid, context=None):
102+ ''' Explode all model correctly for partner
103+ '''
104+ print "Start exploding model in part of code"
105+ partner_pool = self.pool.get('fashion.form.partner.rel')
106+ partner_ids = partner_pool.search(cr, uid, [], context=context)
107+ i = 0
108+ for item in partner_pool.browse(cr, uid, partner_ids, context=context):
109+ i += 1
110+ if i % 100 == 0:
111+ print "Record aggiornati: %s" % (i)
112+
113+ # Force rewrite of model for raise write recalculatin of explosion:
114+ partner_pool.write(cr, uid, [item.id], {
115+ #'model': item.model
116+ 'model_customer': item.form_id.model_customer,
117+ 'model_article': item.form_id.model_article,
118+ 'model_number': item.form_id.model_number,
119+ 'model_revision': item.form_id.model_revision,
120+ 'review': item.form_id.review,
121+ }, context=context)
122+ #print item.model, ">", item.form_id.model_customer, item.form_id.model_article, item.form_id.model_number, item.form_id.model_revision, item.form_id.review
123+ return True
124 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
125
126=== modified file 'fashion/etl/errata_corrige.py'
127--- fashion/etl/errata_corrige.py 2014-03-23 21:47:48 +0000
128+++ fashion/etl/errata_corrige.py 2014-09-17 15:12:42 +0000
129@@ -25,7 +25,7 @@
130 sock = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/object' % (server, port), allow_none=True)
131
132 if len(sys.argv) != 2:
133- print "Use: errata_corrige parameters\n parameters: supplier, code, price"
134+ print "Use: errata_corrige parameters\n parameters: supplier, code, price, user, mt, header, colors, model, model_partner"
135 sys.exit()
136 if sys.argv[1] == 'supplier':
137 result = sock.execute(dbname, uid, pwd, "fashion.form" , "correct_supplier_code")
138@@ -51,3 +51,14 @@
139 result = sock.execute(dbname, uid, pwd, "fashion.form" , "set_header")
140 print "Header updated"
141
142+elif sys.argv[1] == 'colors':
143+ result = sock.execute(dbname, uid, pwd, "fashion.form" , "set_colors")
144+ print "Colors updated"
145+
146+elif sys.argv[1] == 'model':
147+ result = sock.execute(dbname, uid, pwd, "fashion.form", "explode_model")
148+ print "Model explosion updated"
149+
150+elif sys.argv[1] == 'model_partner':
151+ result = sock.execute(dbname, uid, pwd, "fashion.form", "explode_model_partner")
152+ print "Model partner explosion updated"
153
154=== modified file 'fashion/etl/import.py'
155--- fashion/etl/import.py 2014-03-24 15:44:29 +0000
156+++ fashion/etl/import.py 2014-09-17 15:12:42 +0000
157@@ -1705,6 +1705,266 @@
158
159 log_event("[INFO]","Total line: ",counter['tot']," (imported: ",counter['new'],") (updated: ", counter['upd'], ")")
160
161+
162+
163+
164+
165+#===========================================#
166+# Importazione Relazione clienti parte costi#
167+#===========================================#
168+only_create = False
169+jump_because_imported = False
170+import pdb; pdb.set_trace()
171+log_event("Start import fashion.form.partner.rel second stes")
172+file_input = os.path.expanduser('~/etl/fashion/SchXtes.txt')
173+openerp_object = 'fashion.form.partner.rel'
174+#fashion_form_partner_rel = {}
175+lines = csv.reader(open(file_input,'rU'),delimiter=separator)
176+counter = {'tot':0, 'new':0, 'upd':0}
177+tot_col = 0
178+max_col = False
179+active_cost_list = []
180+try:
181+ for line in lines:
182+ if jump_because_imported:
183+ break
184+
185+ if not max_col:
186+ max_col = len(line)
187+
188+ #TODO errore creating data, current record:
189+ if counter['tot']<0:
190+ counter['tot'] += 1
191+ continue
192+
193+ if len(line) != max_col:
194+ log_event('[ERROR]', counter['tot'], "Column error! ")
195+ continue
196+
197+ access_2_id = line[0]
198+ form = Prepare(line[1])
199+ fabric = Prepare(line[2])
200+ #name = Prepare(line[4])
201+ #h = Prepare(line[4])
202+ #mt = Prepare(line[5])
203+ cost = format_currency(Prepare(line[6]))
204+ ric1 = format_currency(Prepare(line[7]))
205+ ric2 = format_currency(Prepare(line[8]))
206+ sale = format_currency(Prepare(line[9])) # Price for GM
207+ partner = Prepare(line[10])
208+ note = Prepare(line[11])
209+
210+ try:
211+ access_2_id = int(access_2_id)
212+ form = int(form)
213+ partner = int(partner)
214+ fabric = int(fabric)
215+ if not(form and partner and fabric):
216+ log_event("[ERR] Manca uno dei 3 elementi necessari!")
217+ continue
218+ except:
219+ log_event("[ERR] Jump record for empty form_id!")
220+ continue
221+
222+ form_id = sock.execute(dbname, uid, pwd, 'fashion.form', 'search', [
223+ ('access_id', '=', form)])
224+ if not form_id:
225+ log_event("[WARNING] Jump record for empty form_id!")
226+ continue
227+ form_id = form_id[0]
228+ if form_id not in active_cost_list:
229+ active_cost_list.append(form_id)
230+
231+ partner_id = sock.execute(dbname, uid, pwd, 'res.partner', 'search', [
232+ ('access_id', '=', partner)])
233+ if not partner_id:
234+ log_event("[ERROR] Partner non trovato")
235+ continue
236+ partner_id = partner_id[0]
237+
238+ fabric_id = sock.execute(dbname, uid, pwd, 'fashion.form.fabric', 'search', [
239+ ('access_id', '=', fabric)])
240+ if not fabric_id:
241+ log_event("[ERROR] Tessuto non trovato")
242+ continue
243+ fabric_id = fabric_id[0]
244+
245+ # Start of importation:
246+ counter['tot'] += 1
247+
248+ # test if record exists (basing on Ref. as code of Partner)
249+ item = sock.execute(dbname, uid, pwd, openerp_object , 'search', [
250+ ('access_2_id', '=', access_2_id)])
251+
252+ if not item:
253+ # try to link to partner-fabric id
254+ item = sock.execute(dbname, uid, pwd, openerp_object , 'search', [
255+ ('form_id', '=', form_id),
256+ ('partner_id', '=', partner_id),
257+ ('fabric_id', '=', fabric_id),
258+ ])
259+
260+ if len(item) > 1 :
261+ log_event("[ERROR] More than one key found!")
262+ continue
263+
264+ data = {
265+ 'form_id': form_id,
266+ 'fabric_id': fabric_id,
267+ 'partner_id': partner_id,
268+ #'h_fabric': h_fabric,
269+ #'mt_fabric': mt_fabric,
270+ 'cost': cost,
271+ 'retail': ric1,
272+ 'wholesale': ric2,
273+ 'sale': sale,
274+ 'note_cost': note,
275+ 'access_2_id': access_2_id,
276+ }
277+
278+ if item: # already exist
279+ counter['upd'] += 1
280+ try:
281+ if only_create:
282+ log_event("[INFO]", counter['tot'], "Write", openerp_object, "(jumped only_create clause)")
283+ else:
284+ item_mod = sock.execute(dbname, uid, pwd, openerp_object, 'write', item, data)
285+ log_event("[INFO]", counter['tot'], "Write", openerp_object)
286+ except:
287+ log_event("[ERROR] Modifing data, current record:", data, sys.exc_info())
288+
289+ else:
290+ counter['new'] += 1
291+ try:
292+ openerp_id=sock.execute(dbname, uid, pwd, openerp_object, 'create', data)
293+ log_event("[INFO]", counter['tot'], "Create", openerp_object)
294+ except:
295+ log_event("[ERROR] Error creating data, current record: ", data, sys.exc_info())
296+except:
297+ log_event('>>> [ERROR] Error importing data!')
298+ raise #Exception("Errore di importazione!") # Scrivo l'errore per debug
299+
300+log_event("[INFO]","Total line: ",counter['tot']," (imported: ",counter['new'],") (updated: ", counter['upd'], ")")
301+
302+# Write model_for_cost
303+sock.execute(dbname, uid, pwd, "fashion.form", 'write', active_cost_list, {'model_for_cost': True})
304+
305+#=============================================#
306+# Importazione Relazione clienti listino costi#
307+#=============================================#
308+only_create = False
309+jump_because_imported = False
310+log_event("Start import fashion.form.cost.rel.pricelist")
311+file_input = os.path.expanduser('~/etl/fashion/FornitoriXCosto.txt')
312+openerp_object = 'fashion.form.cost.rel.pricelist'
313+import pdb; pdb.set_trace()
314+lines = csv.reader(open(file_input,'rU'),delimiter=separator)
315+counter = {'tot':0, 'new':0, 'upd':0}
316+tot_col = 0
317+max_col = False
318+try:
319+ for line in lines:
320+ if jump_because_imported:
321+ break
322+
323+ if not max_col:
324+ max_col = len(line)
325+
326+ if counter['tot']<0:
327+ counter['tot'] += 1
328+ continue
329+
330+ if len(line) != max_col:
331+ log_event('[ERROR]', counter['tot'], "Column error! ")
332+ continue
333+
334+ access_id = line[0]
335+ cost = Prepare(line[1]) # rel
336+ partner = Prepare(line[2]) # supplier
337+ value = format_currency(Prepare(line[3]))
338+ note = Prepare(line[4])
339+ current = Prepare(line[5]) == '1'
340+
341+ try:
342+ access_id = int(access_id)
343+ cost = int(cost)
344+ partner = 1000 + int(partner)
345+ if not(cost and partner):
346+ log_event("[ERR] Manca uno dei 2 elementi necessari!")
347+ continue
348+ except:
349+ log_event("[ERR] Jump record for empty form_id!")
350+ continue
351+
352+ cost_id = sock.execute(dbname, uid, pwd, 'fashion.form.cost.rel', 'search', [
353+ ('access_id', '=', cost)])
354+ if not cost_id:
355+ log_event("[WARNING] Jump record for empty cost_id!")
356+ continue
357+ cost_id = cost_id[0]
358+
359+ partner_id = sock.execute(dbname, uid, pwd, 'res.partner', 'search', [
360+ ('access_id', '=', partner)])
361+ if not partner_id:
362+ log_event("[ERROR] Partner non trovato")
363+ continue
364+ partner_id = partner_id[0]
365+
366+ # Start of importation:
367+ counter['tot'] += 1
368+
369+ # test if record exists (basing on Ref. as code of Partner)
370+ item = sock.execute(dbname, uid, pwd, openerp_object , 'search', [
371+ ('access_id', '=', access_id)])
372+
373+ if not item:
374+ # try to link to partner-fabric id
375+ item = sock.execute(dbname, uid, pwd, openerp_object , 'search', [
376+ ('cost_rel_id', '=', cost_id),
377+ ('supplier_id', '=', partner_id),
378+ ])
379+
380+ if len(item) > 1 :
381+ log_event("[ERROR] More than one key found!")
382+ continue
383+
384+ data = {
385+ 'cost_rel_id': cost_id,
386+ 'supplier_id': partner_id,
387+ 'value': value,
388+ 'note': note,
389+ 'current': current,
390+ 'access_id': access_id,
391+ }
392+
393+ if item: # already exist
394+ counter['upd'] += 1
395+ try:
396+ if only_create:
397+ log_event("[INFO]", counter['tot'], "Write", openerp_object, "(jumped only_create clause)")
398+ else:
399+ item_mod = sock.execute(dbname, uid, pwd, openerp_object, 'write', item, data)
400+ log_event("[INFO]", counter['tot'], "Write", openerp_object)
401+ except:
402+ log_event("[ERROR] Modifing data, current record:", data, sys.exc_info())
403+
404+ else:
405+ counter['new'] += 1
406+ try:
407+ openerp_id=sock.execute(dbname, uid, pwd, openerp_object, 'create', data)
408+ log_event("[INFO]", counter['tot'], "Create", openerp_object)
409+ except:
410+ log_event("[ERROR] Error creating data, current record: ", data, sys.exc_info())
411+except:
412+ log_event('>>> [ERROR] Error importing data!')
413+ raise #Exception("Errore di importazione!") # Scrivo l'errore per debug
414+
415+log_event("[INFO]","Total line: ",counter['tot']," (imported: ",counter['new'],") (updated: ", counter['upd'], ")")
416+
417+
418+
419+
420+
421 #===============================#
422 # Importazione Relazione Misure #
423 #===============================#
424
425=== modified file 'fashion/fashion.py'
426--- fashion/fashion.py 2014-09-17 15:07:59 +0000
427+++ fashion/fashion.py 2014-09-17 15:12:42 +0000
428@@ -31,9 +31,9 @@
429 from openerp.tools.translate import _
430
431
432-#==========#
433-# Utility #
434-#==========#
435+# --------
436+# Utility:
437+# --------
438 # TODO eliminare le funzioni, non devono stare qui!
439 def _get_image(self, cr, uid, ids, name, args, context=None):
440 result = dict.fromkeys(ids, False)
441@@ -42,7 +42,8 @@
442 return result
443
444 def _set_image(self, cr, uid, item_id, name, value, args, context=None):
445- return self.write(cr, uid, [item_id], {'image': tools.image_resize_image_big(value)}, context=context)
446+ return self.write(cr, uid, [item_id], {
447+ 'image': tools.image_resize_image_big(value)}, context=context)
448
449
450 class fashion_season(osv.osv):
451@@ -50,9 +51,10 @@
452 '''
453 _name = 'fashion.season'
454 _description = 'Season'
455- _order = 'name'
456+ _order = 'sequence,name'
457
458 _columns = {
459+ 'sequence': fields.integer('Sequence'),
460 'code': fields.char('Cod', size = 10, required = True, help = 'Code used in fabric for join in the name'),
461 'name': fields.char('Name', size = 40, required = True),
462 'note': fields.text('Note'),
463@@ -101,17 +103,23 @@
464 '''
465 _name = 'fashion.form.cost'
466 _description = 'Cost'
467- _order = 'name'
468+ _order = 'sequence,name'
469
470 _columns = {
471- 'name': fields.char('Name', size = 40, required=True),
472- 'note': fields.text('Note'),
473- 'sequence': fields.integer('Sequence'),
474-
475+ 'name': fields.char('Name', size = 40, required=True),
476+ 'note': fields.text('Note'),
477+ 'sequence': fields.integer('Sequence'),
478+ 'cost': fields.float('Cost', digits=(12, 4)),
479+ 'default': fields.boolean('Default'),
480+
481 # Link di importazione:
482 'access_id': fields.integer('Access ID', help="ID Importazione che tiene il link"),
483 }
484
485+ _defaults = {
486+ 'default': False,
487+ }
488+
489 class fashion_form_accessory(osv.osv):
490 '''Table that manages the accessory
491 '''
492@@ -255,31 +263,33 @@
493 _name = 'fashion.form'
494 _inherits = {'product.product': 'product_id', }
495 #_inherit = 'mail.thread' # link to messages
496- _order = 'model_article,model_number,model,review desc'
497+ _order = 'model_article,model_number desc,model_customer,model,review desc'
498
499 _default_extension = 'jpg'
500
501- #====================#
502+ # --------------------
503 # On change functions:
504- #====================#
505+ # --------------------
506 def on_change_model(self, cr, uid, ids, model, context=None):
507 ''' Split model code in all the part
508 '''
509- res={}
510+ res = {'value': {}}
511 if not model:
512 return res
513- model=model.upper()
514- res['value'] = {}
515+ model = model.upper()
516 res['value']['model'] = model
517 if model[0:1].isalpha():
518 if model[1:2].isalpha():
519 model_customer = model[0:1]
520 model_article = model[1:2]
521 else:
522- model_customer = ''
523+ model_customer = False
524 model_article = model[0:1]
525 else:
526- res['warning']={'title':_('warning'),'message':_('Error: Model must start with letter')}
527+ res['warning'] = {
528+ 'title': _('warning'),
529+ 'message': _('Error: Model must start with letter'),
530+ }
531 res['value']['model_customer'] = model_customer
532 res['value']['model_article'] = model_article
533 model_number = ''
534@@ -290,15 +300,14 @@
535 model_number += c
536 else:
537 break
538- #pdb.set_trace()
539 res['value']['model_number'] = int(model_number) if model_number.isdigit() else 0
540- res['value']['model_revision'] = model[i:]
541+ res['value']['model_revision'] = model[i:] or False
542 res['value']['conformed'] = res['value']['model_revision'] == 'C'
543 return res
544
545- #==================#
546+ # ------------------
547 # Utility functions:
548- #==================#
549+ # ------------------
550 # Naming function:
551 def _get_form_name(self, model, review):
552 ''' Return name of form element
553@@ -347,9 +356,9 @@
554 return False
555 return True
556
557- #====================#
558- # Override functions #
559- #====================#
560+ # ------------------
561+ # Override function:
562+ # ------------------
563 def create(self, cr, uid, vals, context=None):
564 """
565 Create a new record for a model ModelName
566@@ -360,10 +369,14 @@
567
568 @return: returns a id of new record
569 """
570+ # Automatic create a name
571 vals['name'] = self._get_form_name(
572 vals.get('model', ''),
573 vals.get('review', 0),
574 )
575+ # Explode model element
576+ vals.update(self.on_change_model(cr, uid, 0, vals.get('model', False), context=context)['value'])
577+
578 return super(fashion_form, self).create(cr, uid, vals, context=context)
579
580 def write(self, cr, uid, ids, vals, context=None):
581@@ -379,7 +392,11 @@
582
583 @return: True on success, False otherwise
584 """
585+ # Explore model element
586+ vals.update(self.on_change_model(cr, uid, 0, vals.get('model', False), context=context)['value'])
587 res = super(fashion_form, self).write(cr, uid, ids, vals, context)
588+
589+ # Automatic create a name model.revision:
590 if 'model' in vals or 'review' in vals:
591 form_proxy = self.browse(cr, uid, ids, context = context)[0]
592 vals['name'] = self._get_form_name(
593@@ -389,9 +406,38 @@
594 res = super(fashion_form, self).write(cr, uid, ids, vals, context)
595 return res
596
597- #==============#
598- # Button event #
599- #==============#
600+ # ------------
601+ # Button event
602+ # ------------
603+ def set_not_cost_model(self, cr, uid, ids, context=None):
604+ ''' Set form for no manage costs
605+ '''
606+ return self.write(cr, uid, ids, {'model_for_cost': False}, context=context)
607+
608+ def set_cost_model(self, cr, uid, ids, context=None):
609+ ''' Set form for no manage costs
610+ '''
611+ # Set default fixed cost in list:
612+ form_proxy = self.browse(cr, uid, ids, context=context)[0]
613+ cost_list_ids = [item.cost_id.id for item in form_proxy.cost_rel_ids]
614+
615+ cost_pool = self.pool.get('fashion.form.cost')
616+ default_ids = cost_pool.search(cr, uid, [('default','=',True)], context=context)
617+ for cost in cost_pool.browse(cr, uid, default_ids, context=context):
618+ if cost.id not in cost_list_ids:
619+ # Create cost and pricelist:
620+ self.pool.get('fashion.form.cost.rel').create(cr, uid, {
621+ 'form_id': ids[0],
622+ 'cost_id': cost.id,
623+ 'value': cost.cost or 0.0
624+ }, context=context)
625+ return self.write(cr, uid, ids, {'model_for_cost': True}, context=context)
626+
627+ def button_refresh(self, cr, uid, ids, context=None):
628+ ''' Dummy action for refresh form
629+ '''
630+ return True
631+
632 def create_update_header(self, cr, uid, ids, context=None):
633 ''' Create a particular line for header (tg. values)
634 > fashion.form.measure.rel
635@@ -528,9 +574,29 @@
636 def form_discarded(self, cr, uid, ids, context=None):
637 return self.write(cr, uid, ids, {'state': 'discarded'}, context=context)
638
639- #==================#
640- # Fields functions #
641- #==================#
642+ # ----------------
643+ # Fields functions
644+ # ----------------
645+ def _get_sum_items(self, cr, uid, ids, name, args, context=None):
646+ ''' Calculate total sum for costs (cost list and accessory)
647+ '''
648+ res = {}
649+ for obj in self.browse(cr, uid, ids, context=context):
650+ res[obj.id] = {}
651+ res[obj.id]['sum_accessory'] = 0.0
652+ res[obj.id]['sum_cost'] = 0.0
653+ if obj.model_for_cost: # calculate only if it's a model (for speed)
654+ for accessory in obj.accessory_rel_ids:
655+ res[obj.id]['sum_accessory'] += accessory.tot_cost
656+ for cost in obj.cost_rel_ids:
657+ res[obj.id]['sum_cost'] += cost.value
658+ res[obj.id]['sum_extra_cost'] = res[obj.id]['sum_cost'] + res[obj.id]['sum_accessory']
659+
660+ else:
661+ res[obj.id]['sum_extra_cost'] = 0.0
662+
663+ return res
664+
665 def _get_draw_image(self, cr, uid, ids, name, args, context=None):
666 ''' Read image from file according to name and version format:
667 MODEL.VERSION.ext
668@@ -588,12 +654,10 @@
669 }
670
671 def set_obsolete(self, cr, uid, ids, context=None):
672- #pdb.set_trace()
673 self.write(cr, uid, ids, {'obsolete':context.get('obsolete',True)})
674 return True
675
676 def set_not_obsolete(self, cr, uid, ids, context=None):
677- #pdb.set_trace()
678 self.set_obsolete(cr, uid, ids, {'obsolete':False})
679 return True
680
681@@ -627,21 +691,36 @@
682 'old_model': fields.boolean('Old Model'),
683 'show_old_model': fields.boolean('Show old model'),
684 'washing': fields.text('Washing'),
685+ 'model_for_cost': fields.boolean('Model for cost', help='Indicates that this form is use for create a pricelist elements'),
686 'col_ref': fields.selection([
687- (1,'col 1'),
688- (2,'col 2'),
689- (3,'col 3'),
690- (4,'col 4'),
691- (5,'col 5'),
692- (6,'col 6'),
693- (7,'col 7'),
694- (8,'col 8'),
695- (9,'col 9'),
696- (10,'col 10'),
697- (11,'col 11'),
698- (12,'col 12'),
699- ], 'Column reference', select=True, required=True),
700-
701+ (1,'col 1'),
702+ (2,'col 2'),
703+ (3,'col 3'),
704+ (4,'col 4'),
705+ (5,'col 5'),
706+ (6,'col 6'),
707+ (7,'col 7'),
708+ (8,'col 8'),
709+ (9,'col 9'),
710+ (10,'col 10'),
711+ (11,'col 11'),
712+ (12,'col 12'),
713+ ], 'Column reference', select=True, required=True),
714+
715+ # Function for totals:
716+ 'sum_accessory': fields.function(_get_sum_items, string="Total accessory",
717+ type="float", digits=(10, 2), store=False, multi='totals',
718+ help="Sum of the accessory list (see page Accessory for details)",
719+ ),
720+ 'sum_cost': fields.function(_get_sum_items, string="Total cost list",
721+ type="float", digits=(10, 2), store=False, multi='totals',
722+ help="Sum of costs in the list on the left",
723+ ),
724+ 'sum_extra_cost': fields.function(_get_sum_items, string="Total extra cost",
725+ type="float", digits=(10, 2), store=False, multi='totals',
726+ help="Sum of accessory cost and cost list (no fabric in this total)",
727+ ),
728+
729 # Image:
730 'draw_image_a': fields.function(_get_draw_image, fnct_inv=_set_draw_image,
731 string="Draw Image A", type="binary", #multi="_get_draw_image",
732@@ -697,14 +776,14 @@
733 ('sample', 'Sample'),
734 ('ok', 'Ok production'),
735 ('produced', 'Produced'),
736- ('discarded', 'Discarded'), ], 'State', select=True),
737+ ('discarded', 'Discarded'),
738+ ], 'State', select=True),
739
740- # Campi model
741+ # Explosion of model
742 'model_customer': fields.char('Sigla cliente', size=1),
743 'model_article': fields.char('Sigla articolo', size=1),
744 'model_number': fields.integer('Numero modello'),
745 'model_revision': fields.char('Revisione', size=3),
746- #'model_internal': fields.boolean('Interno'),
747
748 #'description': fields.char('Description', size = 40, help = 'Description model'),
749 #'supplier': fields.char('Supplier', size = 40, help = 'Supplier of the fabric', required = False),
750@@ -730,6 +809,7 @@
751 'old_model': lambda *x: False,
752 'show_old_model': lambda *x: False,
753 'col_ref': lambda *a: 3,
754+ 'model_for_cost': False,
755 }
756
757 #===================#
758@@ -781,6 +861,9 @@
759 _description = 'Form characteristic relation'
760 _order = 'sequence,id'
761
762+ # ----------------
763+ # On change event:
764+ # ----------------
765 def on_change_upper_characteristic(self, cr, uid, ids, name, context=None):
766 ''' Manages the capital of the fields in the form Characteristic
767 '''
768@@ -797,6 +880,28 @@
769 res['value']['lenght'] = lenght.upper()
770 return res
771
772+ # -------------
773+ # Button event:
774+ # -------------
775+ def duplicate_characteristic(self, cr, uid, ids, context=None):
776+ ''' Duplicate characteristic element
777+ '''
778+ item_proxy = self.browse(cr, uid, ids, context=context)[0]
779+ return self.create(cr, uid, {
780+ 'name': item_proxy.name,
781+ 'sequence': item_proxy.sequence,
782+ 'form_id': item_proxy.form_id.id,
783+ 'characteristic_id': item_proxy.characteristic_id.id if item_proxy.characteristic_id else False,
784+ 'lenght': item_proxy.lenght,
785+ 'old_name': item_proxy.old_name,
786+ 'stitch_type_id': item_proxy.stitch_type_id.id if item_proxy.stitch_type_id else False,
787+ 'stitch_verse_id': item_proxy.stitch_verse_id.id if item_proxy.stitch_verse_id else False,
788+ 'stitch_cut_id': item_proxy.stitch_cut_id.id if item_proxy.stitch_cut_id else False,
789+ 'stitch_top_id': item_proxy.stitch_top_id.id if item_proxy.stitch_top_id else False,
790+ 'stitch_top_type_id': item_proxy.stitch_top_type_id.id if item_proxy.stitch_top_type_id else False,
791+ 'bindello': item_proxy.bindello,
792+ }, context=context)
793+
794 _columns = {
795 'sequence': fields.integer('Seq.'),
796 'form_id': fields.many2one('fashion.form', 'Form'),
797@@ -823,7 +928,7 @@
798 '''
799 _name = 'fashion.form.characteristic.rel.specific'
800 _description = 'Specific'
801- _order = 'name'
802+ _order = 'type,name'
803
804 def create(self, cr, uid, vals, context=None):
805 """
806@@ -881,7 +986,7 @@
807
808 _columns = {
809 'form_id': fields.many2one('fashion.form', 'Form'),
810- 'cost_id': fields.many2one('fashion.form.cost', 'Cost'),
811+ 'cost_id': fields.many2one('fashion.form.cost', 'Cost', required=True),
812 'value': fields.float('Value'),
813 'note': fields.text('Note'),
814
815@@ -889,6 +994,38 @@
816 'access_id': fields.integer('Access ID', help="ID Importazione che tiene il link"),
817 }
818
819+class fashion_form_cost_rel_pricelist(osv.osv):
820+ '''Table that manage the pricelist elements for signle cost
821+ '''
822+ _name = 'fashion.form.cost.rel.pricelist'
823+ _description = 'Pricelist'
824+ _rec_name = 'value'
825+
826+ _columns = {
827+ 'current': fields.boolean('Current', required=False),
828+ 'cost_rel_id': fields.many2one('fashion.form.cost.rel', 'Cost'),
829+ 'supplier_id': fields.many2one('res.partner', 'Supplier', domain=[('supplier','=',True)]),
830+ 'value': fields.float('Value', required=True),
831+ 'note': fields.text('Note'),
832+
833+ # Link di importazione:
834+ 'access_id': fields.integer('Access ID', help="ID Importazione che tiene il link"),
835+ }
836+
837+ _defaults = {
838+ 'current': False,
839+ }
840+
841+class fashion_form_cost_rel(osv.osv):
842+ '''Table that manage the relation cost/form
843+ '''
844+ _name = 'fashion.form.cost.rel'
845+ _inherit = 'fashion.form.cost.rel'
846+
847+ _columns = {
848+ 'pricelist_ids':fields.one2many('fashion.form.cost.rel.pricelist', 'cost_rel_id', 'Pricelist', required=False),
849+ }
850+
851 class fashion_form_accessory_rel(osv.osv):
852 '''Table that manage the relation accessory/form
853 '''
854@@ -896,6 +1033,38 @@
855 _description = 'Relation accessory'
856 _order = 'sequence,id'
857
858+ # -------------
859+ # Button event:
860+ # -------------
861+ def duplicate_accessory(self, cr, uid, ids, context=None):
862+ ''' Duplicate accessory element
863+ '''
864+ item_proxy = self.browse(cr, uid, ids, context=context)[0]
865+ return self.create(cr, uid, {
866+ 'form_id': item_proxy.form_id.id,
867+ 'sequence': item_proxy.sequence,
868+ 'accessory_id': item_proxy.accessory_id.id if item_proxy.accessory_id else False,
869+ 'fabric_id': item_proxy.fabric_id.id if item_proxy.fabric_id else False,
870+ 'name': item_proxy.name,
871+ 'code': item_proxy.code,
872+ 'um': item_proxy.um,
873+ 'quantity': item_proxy.quantity,
874+ 'currency': item_proxy.currency,
875+ 'note': item_proxy.note,
876+ 'gerber_name': item_proxy.gerber_name,
877+ 'gerber_desc': item_proxy.gerber_desc,
878+ 'gerber_h': item_proxy.gerber_h,
879+ 'gerber_l': item_proxy.gerber_l,
880+ 'supplier_id': item_proxy.supplier_id.id if item_proxy.supplier_id else False,
881+ 'pricelist_id': item_proxy.pricelist_id.id if item_proxy.pricelist_id else False,
882+ 'tot_cost': item_proxy.tot_cost,
883+ 'color': item_proxy.color,
884+ 'h': item_proxy.h,
885+ }, context=context)
886+
887+ # ----------
888+ # On change:
889+ # ----------
890 def on_change_calcolate_cost(self, cr, uid, ids, quantity, currency, context=None):
891 '''Calcolate the total cost of the accessory
892 '''
893@@ -965,6 +1134,7 @@
894 try:
895 fabric_proxy = fabric_pool.browse(cr, uid, fabric_id, context=context)
896 res['value']['supplier_id'] = fabric_proxy.supplier_id and fabric_proxy.supplier_id.id or False
897+ res['value']['currency'] = fabric_proxy.cost or 0.0
898 res['value']['name'] = "%s - %s" % (fabric_proxy.code or "", fabric_proxy.perc_composition or "")
899 except:
900 return res
901@@ -1111,8 +1281,8 @@
902 _name = 'fashion.form.partner.rel'
903 _description = 'Relation'
904 _rec_name = 'partner_id'
905- _order = 'model_article,model_number,model,review desc'
906-
907+ _order = 'model_article,model_number desc,model_customer,model,review desc'
908+
909 # --------------------
910 # Override ORM method:
911 # --------------------
912@@ -1127,9 +1297,66 @@
913 return res
914
915 # TODO: name_search
916- #=====================#
917- # On change functions #
918- #=====================#
919+
920+ #--------------
921+ # Button event:
922+ #--------------
923+ def wizard_print_a(self, cr, uid, ids, context=None):
924+ ''' Print directyl report C with totals (instead of wizard)
925+ '''
926+ record_proxy = self.browse(cr, uid, ids, context=context)[0]
927+ datas = {}
928+ datas['active_ids'] = [record_proxy.form_id.id]
929+ datas['active_id'] = record_proxy.form_id.id
930+ datas['partner_fabric_id'] = ids[0]
931+ datas['summary'] = True
932+ datas['image'] = True
933+
934+ return {
935+ 'model': 'fashion.form',
936+ 'type': 'ir.actions.report.xml',
937+ 'report_name': "fashion_form_A",
938+ 'datas': datas,
939+ }
940+
941+ def wizard_print_b(self, cr, uid, ids, context=None):
942+ ''' Print directyl report C with totals (instead of wizard)
943+ '''
944+ record_proxy = self.browse(cr, uid, ids, context=context)[0]
945+ datas = {}
946+ datas['active_ids'] = [record_proxy.form_id.id]
947+ datas['active_id'] = record_proxy.form_id.id
948+ datas['partner_fabric_id'] = ids[0]
949+ datas['total'] = True
950+ datas['image'] = True
951+
952+ return {
953+ 'model': 'fashion.form',
954+ 'type': 'ir.actions.report.xml',
955+ 'report_name': "fashion_form_B",
956+ 'datas': datas,
957+ }
958+
959+ def wizard_print_c(self, cr, uid, ids, context=None):
960+ ''' Print directyl report C with totals (instead of wizard)
961+ '''
962+ record_proxy = self.browse(cr, uid, ids, context=context)[0]
963+ datas = {}
964+ datas['active_ids'] = [record_proxy.form_id.id]
965+ datas['active_id'] = record_proxy.form_id.id
966+ datas['partner_fabric_id'] = ids[0]
967+ datas['image'] = True
968+
969+ return {
970+ 'model': 'fashion.form',
971+ 'type': 'ir.actions.report.xml',
972+ 'report_name': "fashion_form_C",
973+ 'datas': datas,
974+ }
975+
976+ #---------------------
977+ # On change functions:
978+ #---------------------
979 def on_change_symbol_fabric(self, cr, uid, ids, fabric_id, symbol_fabric, article_code, supplier_id, perc_fabric, context=None):
980 ''' Load default wash symbol, maybe in the form are changed
981 '''
982@@ -1139,6 +1366,8 @@
983 res['value']['article_code'] = False
984 res['value']['supplier_id'] = False
985 res['value']['perc_fabric'] = False
986+ res['value']['cost'] = False
987+ res['value']['note_fabric'] = False
988 return res
989
990 fabric_proxy = self.pool.get('fashion.form.fabric').browse(cr, uid, fabric_id, context=context)
991@@ -1146,155 +1375,124 @@
992 res['value']['article_code'] = fabric_proxy.article_code
993 res['value']['supplier_id'] = fabric_proxy.supplier_id.id
994 res['value']['perc_fabric'] = fabric_proxy.perc_composition
995+ res['value']['cost'] = fabric_proxy.cost
996 res['value']['note_fabric'] = "%s%s %s" % (
997 fabric_proxy.supplier_id.name if fabric_proxy.supplier_id else "",
998 " ART %s" % (
999 fabric_proxy.article_code) if fabric_proxy.article_code else "",
1000 fabric_proxy.note or '')
1001 return res
1002-
1003- #==========================#
1004- # Utility: naming function #
1005- #==========================#
1006- #def _get_form_name(self, model, review):
1007- # ''' Return name of form element
1008- # '''
1009- # return "%s.%s" % (model, review)
1010-
1011- #def _get_draw_image_name(self, obj):
1012- # ''' Return name of image from browese obj passed
1013- # '''
1014- # return ("%s.%s" % (self._get_form_name(obj.model, obj.review), 'jpg')).lower()
1015-
1016- #=========================#
1017- # Utility: image function #
1018- #=========================#
1019- #def _get_draw_image_type(self, field_name):
1020- # ''' Return type of image depend on draw field name
1021- # '''
1022- # if field_name == 'draw_image_a':
1023- # return 'A'
1024- # elif field_name == 'draw_image_b':
1025- # return 'B'
1026- # else: #default # TODO photo
1027- # return 'A'
1028-
1029- #def _load_image(self, name, type_image):
1030- # ''' Load image from file:
1031- # '''
1032- # path = os.path.expanduser(os.path.join("~/etl/fashion/image", type_image)) # TODO parametrize
1033- # filename = os.path.join(path, name)
1034- # try:
1035- # f = open(filename, 'rb')
1036- # img = base64.encodestring(f.read())
1037- # f.close()
1038- # except:
1039- # img = False
1040- # return img
1041-
1042- #def _unload_image(self, name, value, type_image):
1043- # ''' Unload image to file:
1044- # '''
1045- # path = os.path.expanduser(os.path.join("~/etl/fashion/image", type_image)) # TODO parametrize
1046- # filename = os.path.join(path, name)
1047- # try:
1048- # f = open(filename, 'wb')
1049- # f.write(base64.decodestring(value))
1050- # f.close()
1051- # except:
1052- # return False
1053- # return True
1054-
1055- #==================#
1056- # Fields functions #
1057- #==================#
1058- #def _get_draw_image(self, cr, uid, ids, name, args, context=None):
1059- # ''' Read image from file according to name and version format:
1060- # MODEL.VERSION.ext
1061- # '''
1062- # res = dict.fromkeys(ids, False)
1063- # for obj in self.browse(cr, uid, ids, context=context):
1064- # res[obj.id] = self._load_image(self._get_draw_image_name(obj.form_id), self._get_draw_image_type(name)) # TODO parametrize
1065+
1066+ def onchange_cost_computation(self, cr, uid, ids, mt_fabric, cost, retail, wholesale, sale, sum_extra_cost, context=None):
1067+ ''' Master event for calculate sale price with all variables
1068+ mt_fabric * cost = cost_tot * (100 + retail) * (100 + wholesale) = sale
1069+ '''
1070+ res = {'value': {}}
1071+ res['value']['total_fabric'] = (mt_fabric or 0.0) * (cost or 0.0)
1072+ res['value']['sale'] = (res['value']['total_fabric'] + sum_extra_cost or 0.0) * (100.0 + (retail or 0.0)) * (100.0 + (wholesale or 0.0)) / 10000.0
1073+ return res
1074+
1075+ #def onchange_sale(self, cr, uid, sale, context=None):
1076+ # ''' Find % of margin for all
1077+ # '''
1078+ # res = {}
1079 # return res
1080
1081- #def _set_draw_image(self, cr, uid, item_id, name, value, args, context=None):
1082- # ''' Write image passed to file
1083- # '''
1084- # obj_proxy = self.browse(cr, uid, item_id, context=context)
1085- # self._unload_image(self._get_draw_image_name(obj_proxy.form_id), value, self._get_draw_image_type(name)) # TODO test return value
1086-
1087+ #------------------
1088+ # Fields functions:
1089+ #------------------
1090+ def _get_total_fabric(self, cr, uid, ids, name, args, context=None):
1091+ ''' Calculate total fabric (cost * mt)
1092+ Total costs (fabric, list, accessory)
1093+ Info for margine and recharge
1094+ '''
1095+ res = {}
1096+ for obj in self.browse(cr, uid, ids, context=context):
1097+ res[obj.id] = {}
1098+ res[obj.id]['total_fabric'] = obj.cost * obj.mt_fabric
1099+ res[obj.id]['total_cost'] = res[obj.id]['total_fabric'] + obj.form_id.sum_extra_cost # TODO + cost list + accessory totale
1100+ profit = obj.sale - res[obj.id]['total_cost']
1101+ res[obj.id]['margin_note'] = _("%5.2f%s(Mar.)\n%5.2f%s(Ric.)\n%10.2f€(Ut.)") % (
1102+ (profit * 100.0 / res[obj.id]['total_cost']) if res[obj.id]['total_cost'] else 0.0,
1103+ "%",
1104+ (profit * 100.0 / obj.sale) if obj.sale else 0.0,
1105+ "%",
1106+ profit,
1107+ )
1108+
1109+ return res
1110+
1111 _columns = {
1112- 'form_id': fields.many2one('fashion.form', 'Form'),
1113- 'partner_id': fields.many2one('res.partner', 'Partner', domain=[('customer','=',True)], required=True),
1114- 'fabric_id': fields.many2one('fashion.form.fabric', 'Fabric',), # required=True), <<<<<<< rimettere obbligatorio dopo!!!
1115- 'desc_fabric': fields.char('Description', size=80),
1116- 'perc_fabric': fields.char('Composition', size=40),
1117- 'corr_fabric': fields.char('Additional description', size=80),
1118- 'symbol_fabric': fields.char('Symbols', size=80),
1119- 'note_fabric': fields.text('Fabric note'),
1120- 'weight': fields.float('Weight', digits=(10, 2)),
1121- 'h_fabric': fields.float('Height', digits=(10, 2)),
1122- 'mt_fabric': fields.float('Meters', digits=(10, 2)),
1123- 'h_lining': fields.float('Height', digits=(10, 2)),
1124- 'mt_lining': fields.float('Meters', digits=(10, 2)),
1125- 'cost': fields.float('Cost', digits=(10, 4)),
1126- 'tot_cost': fields.float('Total cost', digits=(10, 4)),
1127- 'detail': fields.char('Detail percentage', size=40),
1128- 'wholesale': fields.char('Wholesale percentage', size=40),
1129- 'department_store': fields.float('Department stores price', digits=(10, 4)),
1130- 'code': fields.char('Customer Code', size=10),
1131- 'gerber_name': fields.char('Name', size=10),
1132- 'gerber_desc': fields.char('Description', size=10),
1133- 'gerber_h': fields.char('Height', size=10),
1134- 'gerber_l': fields.char('Length', size=10),
1135- 'cost_tot': fields.float('Total cost', digits=(10, 4)),
1136- 'fabric_tot': fields.float('Total fabric', digits=(10, 4)),
1137- 'lining_tot': fields.float('Total lining', digits=(10, 4)),
1138- 'perc_reload': fields.float('Reloading percentage', digits=(10, 2)),
1139- 'perc_margin': fields.float('Margin percentage', digits=(10, 2)),
1140- 'sale': fields.float('Selling price', digits=(10, 4)),
1141- 'season_id': fields.many2one('fashion.season', string='Season'),
1142- 'article_code': fields.char('Article code', size=30),
1143- 'supplier_id': fields.many2one('res.partner', 'Supplier', domain=[('supplier','=',True)]),
1144-
1145- # TODO eliminare appena vengono tolte dalle viste (kanban)
1146- #'image': fields.related('form_id', 'image', type='binary', string='Image', readonly=True),
1147- 'draw_image_a': fields.related('form_id', 'draw_image_a', type='binary', string='Image', readonly=True),
1148- #'image_large': fields.related('form_id', 'image_large', type='binary', string='Image', readonly=True),
1149-
1150- # Image:
1151- #'draw_image_a': fields.function(_get_draw_image, fnct_inv=_set_draw_image,
1152- # string="Draw Image A", type="binary", #multi="_get_draw_image",
1153- # help="Image for draw side A. Usual size:"\
1154- # "1024 x 768"\
1155- # "The image is printed in report form and, in small size"\
1156- # "in kanban report views",
1157- #),
1158- #'draw_image_b': fields.function(_get_draw_image, fnct_inv=_set_draw_image,
1159- # string="Draw Image B", type="binary", #multi="_get_draw_image",
1160- # help="Image for draw side B. Usual size:"\
1161- # "1024 x 768"\
1162- # "The image is printed in report form and, in small size"\
1163- # "in kanban report views",
1164- #),
1165-
1166- 'article_id': fields.related('form_id', 'article_id', type='many2one', relation='fashion.article', string='Article', readonly=True, store=True),
1167- 'cost_id': fields.many2one('fashion.form.cost', 'Cost'),
1168- 'value': fields.float('Value', digits = (10, 2)),
1169- 'note': fields.text('Note'),
1170-
1171- # Related fields:
1172- 'model': fields.related('form_id', 'model', type='char', string='Modello', size=14, store=True),
1173- 'model_customer': fields.related('form_id', 'model_customer', type='char', string='Sigla cliente', size=1, store=True),
1174- 'model_article': fields.related('form_id', 'model_article', type='char', string='Sigla articolo', size=1, store=True),
1175- 'model_number': fields.related('form_id', 'model_number', type='integer', string='Numero modello', store=True),
1176- 'model_revision': fields.related('form_id', 'model_revision', type='char', string='Revisione', size=3, store=True),
1177- 'review': fields.related('form_id', 'review', type='integer', string='Revisione', store=True),
1178- # conformed
1179-
1180- # Link di importazione:
1181- 'access_id': fields.integer('Access ID', help="ID Importazione che tiene il link"),
1182- }
1183+ 'form_id': fields.many2one('fashion.form', 'Form'),
1184+ 'partner_id': fields.many2one('res.partner', 'Partner', domain=[('customer','=',True)], required=True),
1185+ 'fabric_id': fields.many2one('fashion.form.fabric', 'Fabric',), # required=True), <<<<<<< rimettere obbligatorio dopo!!!
1186+ 'desc_fabric': fields.char('Description', size=80),
1187+ 'perc_fabric': fields.char('Composition', size=40),
1188+ 'corr_fabric': fields.char('Additional description', size=80),
1189+ 'symbol_fabric': fields.char('Symbols', size=80),
1190+ 'note_fabric': fields.text('Fabric note'),
1191+ 'note_cost': fields.text('Cost note'),
1192+ 'weight': fields.float('Weight', digits=(10, 2)),
1193+
1194+ 'h_fabric': fields.float('H.', digits=(10, 2)),
1195+ 'mt_fabric': fields.float('Mt.', digits=(10, 2)),
1196+
1197+ 'cost': fields.float('Cost', digits=(10, 4), help="Unit price for fabric"),
1198+ 'retail': fields.float('Retail', digits=(10, 4)),
1199+ 'wholesale': fields.float('Wholesale', digits=(10, 4)),
1200+ 'sale': fields.float('Selling price', digits=(10, 4)),
1201+
1202+ # Calculated fields:
1203+ 'total_fabric': fields.function(_get_total_fabric, string="Total fabric",
1204+ type="float", digits=(10, 2), store=False, multi='totals'), # m_lining * cost
1205+ 'total_cost': fields.function(_get_total_fabric, string="Total cost",
1206+ type="float", digits=(10, 2), store=False, multi='totals'), # total_fabric + cost list + accessory
1207+ 'margin_note': fields.function(_get_total_fabric, string="Balance",
1208+ type="char", size=100, store=False, multi='totals'), # margin information
1209+
1210+
1211+ 'code': fields.char('Customer Code', size=10),
1212+ 'gerber_name': fields.char('Name', size=10),
1213+ 'gerber_desc': fields.char('Description', size=10),
1214+ 'gerber_h': fields.char('Height', size=10),
1215+ 'gerber_l': fields.char('Length', size=10),
1216+
1217+ 'season_id': fields.many2one('fashion.season', string='Season'),
1218+ 'article_code': fields.char('Article code', size=30),
1219+ 'supplier_id': fields.many2one('res.partner', 'Supplier', domain=[('supplier','=',True)]),
1220+
1221+ # TODO eliminare:
1222+ 'perc_reload': fields.float('Reloading percentage', digits=(10, 2)),
1223+ 'perc_margin': fields.float('Margin percentage', digits=(10, 2)),
1224+ ##'cost_tot': fields.float('Total cost', digits=(10, 4)),
1225+ #'tot_cost': fields.float('Total cost', digits=(10, 4)), # TODO remove (transformed in function
1226+ #'department_store': fields.float('Department stores price', digits=(10, 4)),
1227+ #'fabric_tot': fields.float('Total fabric', digits=(10, 4)),
1228+ #'lining_tot': fields.float('Total lining', digits=(10, 4)), # TODO remove
1229+
1230+ # TODO eliminare appena vengono tolte dalle viste (kanban)
1231+ #'image': fields.related('form_id', 'image', type='binary', string='Image', readonly=True),
1232+ 'draw_image_a': fields.related('form_id', 'draw_image_a', type='binary', string='Image', readonly=True),
1233+ #'image_large': fields.related('form_id', 'image_large', type='binary', string='Image', readonly=True),
1234+
1235+ 'cost_id': fields.many2one('fashion.form.cost', 'Cost'),
1236+ 'value': fields.float('Value', digits=(10, 2)),
1237+ 'note': fields.text('Note'),
1238+ 'article_id': fields.related('form_id', 'article_id', type='many2one', relation='fashion.article', string='Article', readonly=True, store=True),
1239+
1240+ # Related fields (for search):
1241+ 'model': fields.related('form_id', 'model', type='char', string='Modello', size=14, store=True),
1242+ 'model_customer': fields.related('form_id', 'model_customer', type='char', string='Sigla cliente', size=1, store=True),
1243+ 'model_article': fields.related('form_id', 'model_article', type='char', string='Sigla articolo', size=1, store=True),
1244+ 'model_number': fields.related('form_id', 'model_number', type='integer', string='Numero modello', store=True),
1245+ 'model_revision': fields.related('form_id', 'model_revision', type='char', string='Revisione', size=3, store=True),
1246+ 'review': fields.related('form_id', 'review', type='integer', string='Revisione', store=True),
1247+ # conformed
1248+
1249+ # Link di importazione:
1250+ 'access_id': fields.integer('Access ID', help="ID Importazione che tiene il link"),
1251+ 'access_2_id': fields.integer('Access 2 ID', help="ID Importazione che tiene il link con partner costi"),
1252+ }
1253
1254 class res_partner(osv.osv):
1255 '''
1256
1257=== modified file 'fashion/fashion_view.xml'
1258--- fashion/fashion_view.xml 2014-03-23 22:07:35 +0000
1259+++ fashion/fashion_view.xml 2014-09-17 15:12:42 +0000
1260@@ -9,11 +9,12 @@
1261 <field name="arch" type="xml">
1262 <form string="Season" version="7.0">
1263 <sheet>
1264- <group colspan='4' col='4'>
1265+ <group colspan='4' col='6'>
1266+ <field name="sequence"/>
1267 <field name="code"/>
1268 <field name="name"/>
1269- <separator string='Note' colspan='4'/>
1270- <field name="note" nolabel='1' colspan='4'/>
1271+ <separator string='Note' colspan='6'/>
1272+ <field name="note" nolabel='1' colspan='6'/>
1273 </group>
1274 </sheet>
1275 </form>
1276@@ -25,6 +26,7 @@
1277 <field name="model">fashion.season</field>
1278 <field name="arch" type="xml">
1279 <tree string="Season">
1280+ <field name="sequence"/>
1281 <field name="code"/>
1282 <field name="name"/>
1283 <field name="note"/>
1284@@ -89,6 +91,8 @@
1285 <group colspan='4' col='4'>
1286 <field name="sequence"/>
1287 <field name="name"/>
1288+ <field name="default"/>
1289+ <field name="cost"/>
1290 <separator string='Note' colspan='4'/>
1291 <field name="note" nolabel='1' colspan='4'/>
1292 </group>
1293@@ -103,13 +107,15 @@
1294 <field name="arch" type="xml">
1295 <tree string="Cost">
1296 <field name="sequence"/>
1297+ <field name="default"/>
1298 <field name="name"/>
1299+ <field name="cost"/>
1300 <field name="note"/>
1301 </tree>
1302 </field>
1303 </record>
1304
1305- <record id="action_fashion_form_cost" model="ir.actions.act_window">
1306+ <record id="action_fashion_form_cost_fixed" model="ir.actions.act_window">
1307 <field name="name">Fashion cost</field>
1308 <field name="res_model">fashion.form.cost</field>
1309 <field name="view_type">form</field>
1310@@ -327,9 +333,17 @@
1311 <field name="view_id" ref="fashion_form_fabric_tree"/>
1312 <field name="view_id" ref="fashion_form_fabric_search"/>
1313 </record>
1314+ <record id="action_fashion_form_fabric_test" model="ir.actions.act_window">
1315+ <field name="name">Test fabric</field>
1316+ <field name="res_model">fashion.form.fabric</field>
1317+ <field name="view_type">form</field>
1318+ <field name="view_mode">tree,form</field>
1319+ <field name="view_id" ref="fashion_form_fabric_tree"/>
1320+ <field name="view_id" ref="fashion_form_fabric_search"/>
1321+ <field name="context">{'search_default_test':1}</field>
1322+ </record>
1323
1324 <!--fashion.form.stitch-->
1325-
1326 <record id="fashion_form_stitch_form" model="ir.ui.view">
1327 <field name="name">fashion.form.stitch.form</field>
1328 <field name="model">fashion.form.stitch</field>
1329@@ -476,32 +490,34 @@
1330
1331 <button string='Draft' name='form_discarded_draft' type='workflow' states='discarded' icon='gtk-refresh'/>
1332 <label string=" "/>
1333+
1334 <button string='Duplication' name="%(fashion.action_fashion_duplication)d" type="action" icon='STOCK_COPY'/>
1335- <button string='Print' name='%(fashion.action_report_wizard_duplication)d' type="action" />
1336+ <button string='Print' name='%(fashion.action_report_wizard_duplication)d' type="action" icon='gtk-print-preview'/>
1337 <label string=" " />
1338
1339- <button string='Obsolete' name='set_obsolete' type="object" attrs="{'invisible': [('obsolete','=',True)]}" context="{'obsolete':True}"/>
1340- <button string='Not obsolete' name='set_obsolete' type="object" attrs="{'invisible': [('obsolete','=',False)]}" context="{'obsolete':False}"/>
1341+ <button string='Obsolete' name='set_obsolete' type="object" attrs="{'invisible': [('obsolete','=',True)]}" context="{'obsolete':True}" icon='STOCK_NO'/>
1342+ <button string='Not obsolete' name='set_obsolete' type="object" attrs="{'invisible': [('obsolete','=',False)]}" context="{'obsolete':False}" icon='STOCK_YES'/>
1343+ <label string=" " />
1344+
1345+ <button string='Refresh' name='button_refresh' type="object" icon='gtk-refresh'/>
1346 <field name='state' widget='statusbar' readonly='1'/>
1347 </header>
1348 <sheet>
1349 <group col='4'>
1350- <!--<field name="image_medium" widget="image" class="oe_avatar oe_left" modifiers="{}" nolabel='1'/>-->
1351 <div class="oe_title" colspan="4">
1352 <h1>
1353- <field name="model" />
1354+ <field name="model" on_change='on_change_model(model)'/>
1355 </h1>
1356 </div>
1357 <newline/>
1358- <!--<field name="model" on_change="on_change_model(model)"/>-->
1359 <field name="write_date" />
1360 <field name="review"/>
1361- <field name="user_id" />
1362+ <field name="user_id" options="{'create': false, 'create_edit': false}"/>
1363 <field name="base_id" readonly="1"/>
1364- <field name="size_base"/> <!--class="oe_wash_symbol"/>-->
1365+ <field name="size_base"/>
1366
1367 <field name="original" placeholder="Add a generic model that started..."/>
1368- <field name="season_id"/>
1369+ <field name="season_id" options="{'create': false, 'create_edit': false}"/>
1370 <field name="show_old_model" attrs="{'invisible': [('old_model','=',False)]}"/>
1371 <field name="old_model" invisible='1'/>
1372
1373@@ -535,101 +551,79 @@
1374 </group>
1375 </page>
1376 <page string='Client'>
1377- <group colspan='4' col='4'>
1378- <field name="partner_rel_ids" nolabel='1' colspan='4'>
1379+ <group colspan='4' col='6'>
1380+ <separator string="Fabric cost list" colspan='2' groups="fashion.group_fashion_accounting"/>
1381+ <button string='Cost model' name='set_cost_model' type="object" icon='terp-dolar' groups="fashion.group_fashion_accounting" colspan="1" attrs="{'invisible':[('model_for_cost','=',True)]}"/>
1382+ <button string='Not cost model' name='set_not_cost_model' type="object" icon='terp-stock_format-default' groups="fashion.group_fashion_accounting" colspan="1" attrs="{'invisible':[('model_for_cost','=',False)]}"/>
1383+ <button string='Calculate' name='button_refresh' type="object" icon='stock_graph' groups="fashion.group_fashion_accounting" colspan="1" attrs="{'invisible':[('model_for_cost','=',False)]}"/>
1384+ <field name="model_for_cost" groups="fashion.group_fashion_accounting" invisible="1" />
1385+
1386+ <field name="partner_rel_ids" nolabel='1' colspan='6'>
1387 <tree string="Partner" editable="bottom">
1388 <field name='partner_id'/>
1389 <field name='fabric_id' on_change="on_change_symbol_fabric(fabric_id,symbol_fabric,article_code,supplier_id,perc_fabric)"/>
1390- <field name='supplier_id'/>
1391- <field name='article_code'/>
1392- <field name='perc_fabric'/>
1393- <field name='symbol_fabric'/>
1394+ <field name='supplier_id' groups="fashion.group_fashion_production" invisible="context.get('view_cost',False)"/>
1395+ <field name='article_code' groups="fashion.group_fashion_production" invisible="context.get('view_cost',False)"/>
1396+ <field name='perc_fabric' groups="fashion.group_fashion_production" invisible="context.get('view_cost',False)"/>
1397+ <field name='symbol_fabric' groups="fashion.group_fashion_production" invisible="context.get('view_cost',False)"/>
1398 <field name='h_fabric'/>
1399- <field name='mt_fabric'/>
1400- <field name='h_lining' string="H. fod." invisible="1" />
1401- <field name='mt_lining' string="mt. fod." invisible="1" />
1402- <field name='note_fabric'/>
1403- <!--<field name='cost_tot' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin"/>
1404- <field name='fabric_tot' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin"/>
1405- <field name='lining_tot' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin"/>
1406- <field name='tot_cost' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin"/>-->
1407- <field name='perc_reload' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin" invisible="1"/>
1408- <field name='perc_margin' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin" invisible="1"/>
1409- <field name='sale' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin" invisible="1"/>
1410+ <field name='mt_fabric' on_change="onchange_cost_computation(mt_fabric,cost,retail,wholesale,sale,parent.sum_extra_cost)"/>
1411+ <field name='note_fabric' groups="fashion.group_fashion_production" invisible="context.get('view_cost',False)"/>
1412+
1413+ <field name='cost' groups="fashion.group_fashion_accounting" on_change="onchange_cost_computation(mt_fabric,cost,retail,wholesale,sale,parent.sum_extra_cost)" />
1414+
1415+ <field name='total_fabric' groups="fashion.group_fashion_accounting" invisible="context.get('view_production',False)"/>
1416+ <field name='total_cost' groups="fashion.group_fashion_accounting" invisible="context.get('view_production',False)"/>
1417+
1418+ <field name='wholesale' groups="fashion.group_fashion_accounting" on_change="onchange_cost_computation(mt_fabric,cost,retail,wholesale,sale,parent.sum_extra_cost)" invisible="context.get('view_production',False)"/>
1419+ <field name='retail' groups="fashion.group_fashion_accounting" on_change="onchange_cost_computation(mt_fabric,cost,retail,wholesale,sale,parent.sum_extra_cost)" invisible="context.get('view_production',False)"/>
1420+ <field name='sale' groups="fashion.group_fashion_accounting" />
1421+ <field name='margin_note' groups="fashion.group_fashion_accounting" invisible="context.get('view_production',False)"/>
1422+ <field name='note_cost' groups="fashion.group_fashion_accounting" invisible="context.get('view_production',False)"/>
1423+ <button string='[A]' name='wizard_print_a' type="object" groups="fashion.group_fashion_accounting"/> <!--icon='gtk-print-preview' -->
1424+ <button string='[B]' name='wizard_print_b' type="object" groups="fashion.group_fashion_accounting"/> <!--icon='gtk-print-preview' -->
1425+ <button string='[C]' name='wizard_print_c' type="object" groups="fashion.group_fashion_accounting"/>
1426 </tree>
1427- <form string="Partner">
1428- <group col='4'>
1429- <field name='partner_id'/>
1430- <!--<field name='code'/>-->
1431- <field name='season_id' />
1432- <field name='fabric_id' domain="[('season_id','=',season_id)]" on_change="on_change_symbol_fabric(fabric_id,symbol_fabric,article_code,supplier_id,perc_fabric)"/><!--attrs="{'invisible':[('season_id','=',False)]}"-->
1433- <field name='symbol_fabric' /><!--attrs="{'invisible':[('season_id','=',False)]}"-->
1434- <field name='supplier_id' />
1435- <field name='article_code' />
1436- <notebook colspan='4'>
1437- <page string='Fabric'>
1438- <group col='4'>
1439- <field name='desc_fabric'/>
1440- <field name='perc_fabric'/>
1441- <field name='corr_fabric'/>
1442- <field name='weight'/>
1443- <field name='h_fabric'/>
1444- <field name='mt_fabric'/>
1445- <field name='detail'/>
1446- <field name='wholesale' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin"/>
1447- <field name='department_store'/>
1448- <separator string='Note' colspan='4'/>
1449- <field name='note_fabric' nolabel='1' colspan='4' placeholder='Add a fabric note...'/>
1450- </group>
1451- </page>
1452- <page string='Lining'>
1453- <group col='4'>
1454- <field name='h_lining'/>
1455- <field name='mt_lining'/>
1456- <field name='cost' groups="fashion.group_fashion_accounting,fashion.group_fashion_admin"/>
1457- </group>
1458- </page>
1459- <page string='Gerber' groups="fashion.group_fashion_gerber">
1460- <group col='4'>
1461- <field name='gerber_name'/>
1462- <field name='gerber_desc'/>
1463- <field name='gerber_h'/>
1464- <field name='gerber_l'/>
1465- </group>
1466- </page>
1467- <page string='Statistics' groups='fashion.group_fashion_accounting,fashion.group_fashion_admin'>
1468- <group col='4'>
1469- <field name='cost_tot' />
1470- <field name='fabric_tot'/>
1471- <field name='lining_tot'/>
1472- <field name='tot_cost'/>
1473- <field name='perc_reload'/>
1474- <field name='perc_margin'/>
1475- <field name='sale'/>
1476- </group>
1477- </page>
1478- <!--<page string='Costs'>
1479- <group colspan='4'>
1480- <field name="cost_rel_ids" nolabel='1' colspan='4'>
1481- <tree string="Cost" editable='bottom'>
1482- <field name='cost_id'/>
1483- <field name='value'/>
1484- <field name='note'/>
1485- </tree>
1486- <field name="h_lining"/>
1487- <field name="mt_lining"/>
1488- <field name="cost_lining"/>
1489- </field>
1490- </group>
1491- </page>-->
1492- </notebook>
1493- </group>
1494- </form>
1495 </field>
1496+ </group>
1497+ <group colspan='4' col='4' groups="fashion.group_fashion_accounting" attrs="{'invisible':[('model_for_cost','=',False)]}">
1498+ <group colspan="2" col="2">
1499+ <separator string="Cost list" colspan='2' />
1500+ <field name="cost_rel_ids" nolabel='1' colspan='2'>
1501+ <tree string="Cost">
1502+ <field name='cost_id'/>
1503+ <field name='value' sum="total" />
1504+ <field name='note'/>
1505+ </tree>
1506+ <form string="Cost">
1507+ <field name='cost_id'/>
1508+ <field name='value' sum="total" />
1509+ <separator string="Pricelist" colspan="4"/>
1510+ <field name='pricelist_ids' colspan="4" nolabel="1">
1511+ <tree string="Pricelist" editable="bottom" colors="grey:current==False;green:current==True">
1512+ <field name="current"/>
1513+ <field name="supplier_id"/>
1514+ <field name="value"/>
1515+ <field name="note"/>
1516+ </tree>
1517+ </field>
1518+ <separator string="Note" colspan="4"/>
1519+ <field name='note' colspan="4" nolabel="1"/>
1520+ </form>
1521+ </field>
1522+ </group>
1523+ <group colspan="2" col="2">
1524+ <separator string="Summary cost" colspan='2' />
1525+ <field name="sum_cost" />
1526+ <field name="sum_accessory"/>
1527+ <field name="sum_extra_cost" string="Totale costi"/>
1528+ </group>
1529+ </group>
1530+ <group colspan='4' col='4' groups="fashion.group_fashion_production">
1531+ <separator string="Production info" colspan='4' />
1532 <field name="customer_code" />
1533 <field name="cut" placeholder="Add number of cut-out models..."/>
1534- <newline/>
1535- <field name="size" colspan='4' placeholder="Add sizes achieve..."/>
1536+ <field name="size" placeholder="Add sizes achieve..."/>
1537 <field name="colors" placeholder="Add colors to be cut..."/>
1538 </group>
1539 </page>
1540@@ -660,6 +654,7 @@
1541 <!--<field name='stitch_top_type_id' context="{'default_type':'5'}" />-->
1542 <field name='bindello'/>
1543 <field name='name' on_change="on_change_upper_characteristic(name)" string="Description"/>
1544+ <button name="duplicate_characteristic" type="object" string="Duplicate" icon="STOCK_COPY" />
1545 </tree>
1546 </field>
1547 <separator string='Ironing' colspan='4'/>
1548@@ -690,6 +685,7 @@
1549 <field name='gerber_desc' groups="fashion.group_fashion_gerber"/>
1550 <field name='gerber_h' groups="fashion.group_fashion_gerber"/>
1551 <field name='gerber_l' groups="fashion.group_fashion_gerber"/>
1552+ <button name="duplicate_accessory" type="object" string="Duplicate" icon="STOCK_COPY" />
1553 </tree>
1554 </field>
1555 </group>
1556@@ -791,8 +787,8 @@
1557
1558 <button string='Draft' name='form_discarded_draft' type='workflow' states='discarded' icon='gtk-refresh'/>
1559
1560- <button string='Obsolete' name='set_obsolete' type="object" attrs="{'invisible': [('obsolete','=',True)]}"/>
1561- <button string='Not obsolete' name='set_not_obsolete' type="object" attrs="{'invisible': [('obsolete','=',False)]}"/>
1562+ <button string='Obsolete' name='set_obsolete' type="object" attrs="{'invisible': [('obsolete','=',True)]}" icon='STOCK_NO'/>
1563+ <button string='Not obsolete' name='set_not_obsolete' type="object" attrs="{'invisible': [('obsolete','=',False)]}" icon='STOCK_YES'/>
1564 <field name='state' readonly='1'/>
1565 </tree>
1566 </field>
1567@@ -850,8 +846,10 @@
1568 <filter name="inactive" string="Not Active" domain="['|',('state','=','discarded'),('obsolete','=',True)]"/>
1569
1570 <separator/>
1571- <filter string="Obsolete" domain="[('obsolete','=','True')]"/>
1572+ <filter string="Obsolete" domain="[('obsolete','=',True)]"/>
1573 <!--<filter string="My last modified" domain="[('write_uid','=',active_id),('write_date','&gt;=',(context_today() - datetime.timedelta(1)).strftime('%%Y-%%m-%%d 00:00:00')]"/>-->
1574+ <filter string="Company form" domain="[('model_customer','=',False)]"/>
1575+ <filter name="only_model_for_cost" string="Model for cost" domain="[('model_for_cost','=',True)]"/>
1576
1577 <separator/>
1578 <filter string="Normal" domain="[('conformed','=',False)]"/>
1579@@ -887,8 +885,18 @@
1580 <field name="view_type">form</field>
1581 <field name="view_mode">tree,form,kanban,calendar</field>
1582 <field name="view_id" ref="fashion_form_tree" />
1583+ <field name="context">{'view_production':1,'default_user_id':uid}</field>
1584+ <field name="domain">[('obsolete','=',False),('state','!=','discarded')]</field>
1585+ </record>
1586+ <record id="action_fashion_form_cost" model="ir.actions.act_window">
1587+ <field name="name">Fashion form cost</field>
1588+ <field name="res_model">fashion.form</field>
1589+ <field name="view_type">form</field>
1590+ <field name="view_mode">tree,form,kanban,calendar</field>
1591+ <field name="view_id" ref="fashion_form_tree" />
1592 <field name="context">{'default_user_id':uid}</field>
1593 <field name="domain">[('obsolete','=',False),('state','!=','discarded')]</field>
1594+ <field name="context">{'view_cost':1,'search_default_only_model_for_cost':1}</field>
1595 </record>
1596 <record id="action_fashion_form_obsolete" model="ir.actions.act_window">
1597 <field name="name">Fashion form</field>
1598@@ -896,10 +904,25 @@
1599 <field name="view_type">form</field>
1600 <field name="view_mode">tree,form,kanban,calendar</field>
1601 <field name="view_id" ref="fashion_form_tree" />
1602- <field name="context">{'search_default_inactive':True,'default_user_id':uid}</field>
1603+ <field name="context">{'view_production':1,'search_default_inactive':True,'default_user_id':uid}</field>
1604 </record>
1605
1606 <!--fashion.form.characteristic.rel.specific-->
1607+ <record id="fashion_form_characteristic_rel_specific_search" model="ir.ui.view">
1608+ <field name="name">fashion.form.characteristic.rel.specific.search</field>
1609+ <field name="model">fashion.form.characteristic.rel.specific</field>
1610+ <field name="arch" type="xml">
1611+ <search string="Terms">
1612+ <field name="name" filter_domain="[('name','ilike',self)]"/>
1613+ <field name="type" filter_domain="[('type,'ilike',self)]"/>
1614+
1615+ <group expand="1" string="Group By...">
1616+ <filter name='group_type' string="Type" domain="[]" context="{'group_by':'type'}"/>
1617+ </group>
1618+ </search>
1619+ </field>
1620+ </record>
1621+
1622 <record id="fashion_form_characteristic_rel_specific_form" model="ir.ui.view">
1623 <field name="name">fashion.form.characteristic.rel.specific.form</field>
1624 <field name="model">fashion.form.characteristic.rel.specific</field>
1625@@ -926,6 +949,14 @@
1626 </field>
1627 </record>
1628
1629+ <record id="action_fashion_form_characteristic_rel_specific" model="ir.actions.act_window">
1630+ <field name="name">Caracteristic terms</field>
1631+ <field name="res_model">fashion.form.characteristic.rel.specific</field>
1632+ <field name="view_type">form</field>
1633+ <field name="view_mode">tree,form</field>
1634+ <field name="view_id" ref="fashion_form_characteristic_rel_specific_tree"/>
1635+ </record>
1636+
1637 <!--res.partner-->
1638 <!-- <record id='res_partner_fashion_form' model='ir.ui.view'>
1639 <field name='name'>res.partner.fashion.form</field>
1640@@ -939,7 +970,6 @@
1641 </record>-->
1642
1643 <!--fashion.form.partner.rel-->
1644-
1645 <record id="fashion_form_partner_rel_form" model="ir.ui.view">
1646 <field name="name">fashion.form.partner.rel.form</field>
1647 <field name="model">fashion.form.partner.rel</field>
1648@@ -955,9 +985,9 @@
1649 <newline/>
1650 <field name="partner_id" readonly="1"/>
1651 <field name="fabric_id" readonly="1"/>
1652- <field name="detail" groups='fashion.group_fashion_accounting' readonly="1"/>
1653+ <field name="retail" groups='fashion.group_fashion_accounting' readonly="1"/>
1654 <field name="wholesale" groups='fashion.group_fashion_accounting' readonly="1"/>
1655- <field name="department_store" groups='fashion.group_fashion_accounting' readonly="1"/>
1656+ <!--<field name="department_store" groups='fashion.group_fashion_accounting' readonly="1"/>-->
1657 <separator string="Image:"/>
1658 <field name="draw_image_a" widget="image" class="oe_avatar oe_left" nolabel='1' colspan="4" readonly="1"/>
1659 </group>
1660@@ -976,9 +1006,9 @@
1661 <field name="article_id"/>
1662 <field name="partner_id"/>
1663 <field name="fabric_id"/>
1664- <field name="detail" groups='fashion.group_fashion_accounting'/>
1665+ <field name="retail" groups='fashion.group_fashion_accounting'/>
1666 <field name="wholesale" groups='fashion.group_fashion_accounting'/>
1667- <field name="department_store" groups='fashion.group_fashion_accounting'/>
1668+ <!--<field name="department_store" groups='fashion.group_fashion_accounting'/>-->
1669 <field name="model" invisible="1" />
1670 <field name="model_article" invisible="1" />
1671 <field name="model_customer" invisible="1" />
1672@@ -1054,20 +1084,23 @@
1673 </record>
1674
1675 <!--Menuitem-->
1676-
1677- <menuitem name="Fashion" id="menu_fashion_root" sequence="5" />
1678+ <menuitem name="Fashion" id="menu_fashion_root" sequence="5" />
1679 <menuitem name="Form" parent="menu_fashion_root" id="menu_fashion_form" sequence="10"/>
1680+ <menuitem name="Form for cost" parent="menu_fashion_form" id="menu_fashion_form_form_cost" sequence="5" action="action_fashion_form_cost" groups="fashion.group_fashion_accounting"/>
1681 <menuitem name="Form" parent="menu_fashion_form" id="menu_fashion_form_form" sequence="10" action="action_fashion_form"/>
1682 <menuitem name="Inactive form" parent="menu_fashion_form_form" id="menu_fashion_form_inactive_form" sequence="10" action="action_fashion_form_obsolete"/>
1683- <menuitem name="Fowm with client" parent="menu_fashion_form" id="menu_fashion_form_form_client" sequence="20" action="action_fashion_form_partner_rel"/>
1684- <menuitem name="Configuration" parent="menu_fashion_root" id="menu_fashion_configuration" sequence="90" groups="fashion.group_fashion_admin"/>
1685+ <menuitem name="Form with client" parent="menu_fashion_form" id="menu_fashion_form_form_client" sequence="20" action="action_fashion_form_partner_rel"/>
1686+ <menuitem name="Configuration" parent="menu_fashion_root" id="menu_fashion_configuration" sequence="90" groups="fashion.group_fashion_admin,fashion.group_fashion_accounting"/>
1687 <menuitem name="Season" parent="menu_fashion_configuration" id="menu_fashion_configuration_season" sequence="10" action='action_fashion_season' />
1688 <menuitem name="Seams" parent="menu_fashion_configuration" id="menu_fashion_configuration_characteristic" sequence="20" action='action_fashion_form_characteristic' />
1689- <menuitem name="Cost" parent="menu_fashion_configuration" id="menu_fashion_configuration_cost" sequence="30" action='action_fashion_form_cost' />
1690+ <!--<menuitem name="Cost (var.)" parent="menu_fashion_configuration" id="menu_fashion_configuration_cost" sequence="30" action='action_fashion_form_cost_variable' />-->
1691+ <menuitem name="Cost (fixed)" parent="menu_fashion_configuration" id="menu_fashion_configuration_cost_fixed" sequence="35" action='action_fashion_form_cost_fixed' groups="fashion.group_fashion_admin,fashion.group_fashion_accounting"/>
1692 <menuitem name="Accessory" parent="menu_fashion_configuration" id="menu_fashion_configuration_accessory" sequence="40" action='action_fashion_form_accessory' />
1693 <menuitem name="Fabric" parent="menu_fashion_configuration" id="menu_fashion_configuration_fabric" sequence="50" action='action_fashion_form_fabric' />
1694+ <menuitem name="Test fabric" parent="menu_fashion_configuration_fabric" id="menu_fashion_configuration_fabric_test" sequence="10" action='action_fashion_form_fabric_test' />
1695 <!--<menuitem name="Seam" parent="menu_fashion_configuration" id="menu_fashion_configuration_stitch" sequence="60" action='action_fashion_form_stitch' />-->
1696 <menuitem name="Measure" parent="menu_fashion_configuration" id="menu_fashion_configuration_measure" sequence="70" action='action_fashion_form_measure' />
1697 <menuitem name="Article" parent="menu_fashion_configuration" id="menu_fashion_configuration_article" sequence="80" action='action_fashion_article' />
1698+ <menuitem name="Car. terms" parent="menu_fashion_configuration" id="menu_fashion_terminology" sequence="90" action='action_fashion_form_characteristic_rel_specific' />
1699 </data>
1700 </openerp>
1701
1702=== modified file 'fashion/i18n/it.po'
1703--- fashion/i18n/it.po 2014-03-23 21:54:01 +0000
1704+++ fashion/i18n/it.po 2014-09-17 15:12:42 +0000
1705@@ -7,8 +7,8 @@
1706 msgstr ""
1707 "Project-Id-Version: OpenERP Server 7.0\n"
1708 "Report-Msgid-Bugs-To: \n"
1709-"POT-Creation-Date: 2014-03-23 21:50+0000\n"
1710-"PO-Revision-Date: 2014-03-23 22:53+0100\n"
1711+"POT-Creation-Date: 2014-05-10 15:59+0000\n"
1712+"PO-Revision-Date: 2014-05-10 18:02+0200\n"
1713 "Last-Translator: <>\n"
1714 "Language-Team: \n"
1715 "MIME-Version: 1.0\n"
1716@@ -18,9 +18,9 @@
1717 "X-Generator: Gtranslator 2.91.5\n"
1718
1719 #. module: fashion
1720-#: field:fashion.form.partner.rel,wholesale:0
1721-msgid "Wholesale percentage"
1722-msgstr "% Ingrosso"
1723+#: selection:fashion.form,col_ref:0
1724+msgid "col 8"
1725+msgstr "col 8"
1726
1727 #. module: fashion
1728 #: view:fashion.form:0 field:fashion.form.stitch.rel,stitch_id:0
1729@@ -45,7 +45,8 @@
1730
1731 #. module: fashion
1732 #: view:fashion.form:0 view:fashion.form.accessory:0
1733-#: view:fashion.form.accessory.pricelist:0 view:fashion.form.fabric:0
1734+#: view:fashion.form.accessory.pricelist:0
1735+#: view:fashion.form.characteristic.rel.specific:0 view:fashion.form.fabric:0
1736 #: view:fashion.form.partner.rel:0
1737 msgid "Group By..."
1738 msgstr "Raggruppa per..."
1739@@ -60,6 +61,7 @@
1740 #: help:fashion.form.characteristic.rel.specific,access_id:0
1741 #: help:fashion.form.comment.rel,access_id:0
1742 #: help:fashion.form.cost,access_id:0 help:fashion.form.cost.rel,access_id:0
1743+#: help:fashion.form.cost.rel.pricelist,access_id:0
1744 #: help:fashion.form.fabric,access_id:0 help:fashion.form.measure,access_id:0
1745 #: help:fashion.form.measure.rel,access_id:0
1746 #: help:fashion.form.partner.rel,access_id:0
1747@@ -89,6 +91,7 @@
1748 #: view:fashion.form.accessory.pricelist:0
1749 #: field:fashion.form.accessory.pricelist,supplier_id:0
1750 #: field:fashion.form.accessory.rel,supplier_id:0
1751+#: field:fashion.form.cost.rel.pricelist,supplier_id:0
1752 #: field:fashion.form.partner.rel,supplier_id:0
1753 msgid "Supplier"
1754 msgstr "Fornitore"
1755@@ -115,9 +118,14 @@
1756 msgstr "Prodotto"
1757
1758 #. module: fashion
1759-#: field:fashion.form.characteristic.rel,stitch_verse_id:0
1760-msgid "Stitch verse"
1761-msgstr "Cucitura inversa"
1762+#: view:fashion.form:0
1763+msgid "Cost list"
1764+msgstr "Lista costi"
1765+
1766+#. module: fashion
1767+#: selection:fashion.form,col_ref:0
1768+msgid "col 10"
1769+msgstr "col 10"
1770
1771 #. module: fashion
1772 #: help:fashion.form,start:0 help:res.partner,start:0
1773@@ -125,7 +133,12 @@
1774 msgstr "Partenza per le taglie conformate"
1775
1776 #. module: fashion
1777-#: code:addons/fashion/fashion.py:282
1778+#: model:ir.model,name:fashion.model_fashion_form
1779+msgid "fashion.form"
1780+msgstr "Schede modelli"
1781+
1782+#. module: fashion
1783+#: code:addons/fashion/fashion.py:290
1784 #, python-format
1785 msgid "warning"
1786 msgstr "attenzione"
1787@@ -141,14 +154,9 @@
1788 msgstr "Modifica"
1789
1790 #. module: fashion
1791-#: view:fashion.form:0
1792-msgid "mt. fod."
1793-msgstr "mt. fod."
1794-
1795-#. module: fashion
1796-#: view:fashion.form:0
1797-msgid "Add a fabric note..."
1798-msgstr "Aggiunte nota tessuto..."
1799+#: field:fashion.form,sum_accessory:0
1800+msgid "Total accessory"
1801+msgstr "Totale accessori"
1802
1803 #. module: fashion
1804 #: help:fashion.form,obsolete:0
1805@@ -156,6 +164,11 @@
1806 msgstr "Indica che la scheda è nel formato vecchio"
1807
1808 #. module: fashion
1809+#: view:fashion.form:0
1810+msgid "Fabric cost list"
1811+msgstr "Lista costi tessuto"
1812+
1813+#. module: fashion
1814 #: selection:fashion.report.wizard,type:0
1815 msgid "Lanciato"
1816 msgstr "Lanciato"
1817@@ -191,14 +204,21 @@
1818 msgstr "Tipo di report"
1819
1820 #. module: fashion
1821-#: model:ir.module.category,description:fashion.module_fashion
1822-msgid "Manage fashion groups."
1823-msgstr "Gestisci gruppi amministrazione."
1824-
1825-#. module: fashion
1826-#: field:fashion.form.cost.rel,value:0 field:fashion.form.partner.rel,value:0
1827-msgid "Value"
1828-msgstr "Valore"
1829+#: help:fashion.form,model_for_cost:0
1830+msgid "Indicates that this form is use for create a pricelist elements"
1831+msgstr ""
1832+"Indica che questa scheda è utilizzata per creare il prezzo di listino di "
1833+"riferimento"
1834+
1835+#. module: fashion
1836+#: view:fashion.form:0
1837+msgid "Refresh"
1838+msgstr "Ricarica"
1839+
1840+#. module: fashion
1841+#: field:fashion.form.characteristic.rel,stitch_verse_id:0
1842+msgid "Stitch verse"
1843+msgstr "Cucitura inversa"
1844
1845 #. module: fashion
1846 #: view:fashion.form:0 selection:fashion.form,state:0
1847@@ -221,9 +241,14 @@
1848 msgstr "Wizard report"
1849
1850 #. module: fashion
1851-#: field:fashion.form.partner.rel,fabric_tot:0
1852-msgid "Total fabric"
1853-msgstr "Totale tessuto"
1854+#: field:fashion.form,sum_extra_cost:0
1855+msgid "Total extra cost"
1856+msgstr "Totale costi"
1857+
1858+#. module: fashion
1859+#: field:fashion.form.measure.rel,visible:0
1860+msgid "Visible"
1861+msgstr "Visibile"
1862
1863 #. module: fashion
1864 #: model:ir.actions.act_window,name:fashion.action_fashion_season
1865@@ -236,7 +261,8 @@
1866 #: field:fashion.form.accessory.pricelist,note:0
1867 #: view:fashion.form.characteristic:0 field:fashion.form.characteristic,note:0
1868 #: view:fashion.form.cost:0 field:fashion.form.cost,note:0
1869-#: field:fashion.form.cost.rel,note:0 view:fashion.form.fabric:0
1870+#: field:fashion.form.cost.rel,note:0
1871+#: field:fashion.form.cost.rel.pricelist,note:0 view:fashion.form.fabric:0
1872 #: field:fashion.form.fabric,note:0 view:fashion.form.measure:0
1873 #: field:fashion.form.measure,note:0 field:fashion.form.partner.rel,note:0
1874 #: view:fashion.form.stitch:0 field:fashion.form.stitch,note:0
1875@@ -309,16 +335,9 @@
1876 msgstr "Cliente"
1877
1878 #. module: fashion
1879-#: field:fashion.form.partner.rel,department_store:0
1880-msgid "Department stores price"
1881-msgstr "Prezzo dettaglio"
1882-
1883-#. module: fashion
1884-#: view:fashion.form:0 view:fashion.form.partner.rel:0
1885-#: field:fashion.form.partner.rel,partner_id:0
1886-#: model:ir.model,name:fashion.model_res_partner
1887-msgid "Partner"
1888-msgstr "Cliente"
1889+#: field:fashion.form.partner.rel,mt_fabric:0
1890+msgid "Mt."
1891+msgstr "Mt."
1892
1893 #. module: fashion
1894 #: field:fashion.form,model_number:0
1895@@ -327,6 +346,11 @@
1896 msgstr "Numero modello"
1897
1898 #. module: fashion
1899+#: model:ir.ui.menu,name:fashion.menu_fashion_terminology
1900+msgid "Car. terms"
1901+msgstr "Termini caratt."
1902+
1903+#. module: fashion
1904 #: model:ir.actions.act_window,name:fashion.act_window_wizard_report_form
1905 msgid "Form Report"
1906 msgstr "Report scheda"
1907@@ -337,6 +361,11 @@
1908 msgstr "OK produrre"
1909
1910 #. module: fashion
1911+#: field:fashion.form.fabric,symbol:0
1912+msgid "Wash symbol"
1913+msgstr "Simboli di lavaggio"
1914+
1915+#. module: fashion
1916 #: view:fashion.form:0
1917 msgid "Add description of parts for washing..."
1918 msgstr "Aggiunte descrizione parte per il lavaggio..."
1919@@ -356,9 +385,9 @@
1920 msgstr "Area"
1921
1922 #. module: fashion
1923-#: view:fashion.form:0
1924-msgid "Lining"
1925-msgstr "Fodera"
1926+#: field:fashion.form.measure.rel,size_11:0
1927+msgid "Size 11"
1928+msgstr "Tg.11"
1929
1930 #. module: fashion
1931 #: view:fashion.duplication:0
1932@@ -371,9 +400,9 @@
1933 msgstr "Elimina immagine"
1934
1935 #. module: fashion
1936-#: field:fashion.form.fabric,symbol:0
1937-msgid "Wash symbol"
1938-msgstr "Simboli di lavaggio"
1939+#: model:ir.actions.act_window,name:fashion.action_fashion_form_characteristic_rel_specific
1940+msgid "Caracteristic terms"
1941+msgstr "Termini caratteristiche"
1942
1943 #. module: fashion
1944 #: field:fashion.form.fabric,perc_composition:0
1945@@ -424,12 +453,13 @@
1946 #. module: fashion
1947 #: view:fashion.form:0 view:fashion.form.accessory:0
1948 #: field:fashion.form.accessory,type:0
1949+#: view:fashion.form.characteristic.rel.specific:0
1950 #: field:fashion.form.characteristic.rel.specific,type:0
1951 msgid "Type"
1952 msgstr "Tipo"
1953
1954 #. module: fashion
1955-#: code:addons/fashion/fashion.py:282
1956+#: code:addons/fashion/fashion.py:291
1957 #, python-format
1958 msgid "Error: Model must start with letter"
1959 msgstr "Errore: il modello deve iniziare con una lettera"
1960@@ -495,6 +525,11 @@
1961 msgstr "Immagine:"
1962
1963 #. module: fashion
1964+#: view:fashion.form:0
1965+msgid "Summary cost"
1966+msgstr "Riepilogo costi"
1967+
1968+#. module: fashion
1969 #: model:res.groups,comment:fashion.group_fashion_user
1970 msgid "User that can only see or consult."
1971 msgstr "Utente che può solo vedere o consultare"
1972@@ -520,8 +555,11 @@
1973 msgstr "Articolo"
1974
1975 #. module: fashion
1976-#: view:fashion.form.accessory:0 field:fashion.form.accessory,pricelist_ids:0
1977+#: view:fashion.form:0 view:fashion.form.accessory:0
1978+#: field:fashion.form.accessory,pricelist_ids:0
1979 #: field:fashion.form.accessory.rel,pricelist_id:0
1980+#: field:fashion.form.cost.rel,pricelist_ids:0
1981+#: model:ir.model,name:fashion.model_fashion_form_cost_rel_pricelist
1982 msgid "Pricelist"
1983 msgstr "Listino"
1984
1985@@ -551,6 +589,18 @@
1986 msgstr "Altezza (Gerber)"
1987
1988 #. module: fashion
1989+#: code:addons/fashion/fashion.py:1426
1990+#, python-format
1991+msgid ""
1992+"Marg. %5.2f%s\n"
1993+"Ric. %5.2f%s\n"
1994+"[%10.2f]"
1995+msgstr ""
1996+"Marg. %5.2f%s\n"
1997+"Ric. %5.2f%s\n"
1998+"[%10.2f]"
1999+
2000+#. module: fashion
2001 #: help:fashion.form,draw_image_b:0 help:fashion.form,draw_image_c:0
2002 #: help:fashion.form,draw_image_d:0
2003 msgid ""
2004@@ -561,6 +611,11 @@
2005 "form and, in small sizein kanban report views"
2006
2007 #. module: fashion
2008+#: help:fashion.form,sum_cost:0
2009+msgid "Sum of costs in the list on the left"
2010+msgstr "Somma dei costi nella lista qui a sinistra"
2011+
2012+#. module: fashion
2013 #: view:fashion.form:0
2014 msgid "Not Active"
2015 msgstr "Non attive"
2016@@ -578,9 +633,16 @@
2017 msgstr "Ok produrre"
2018
2019 #. module: fashion
2020-#: selection:fashion.form,col_ref:0
2021-msgid "col 10"
2022-msgstr "col 10"
2023+#: view:fashion.form:0
2024+msgid "Not cost model"
2025+msgstr "Costi non gestiti"
2026+
2027+#. module: fashion
2028+#: field:fashion.form.cost.rel,value:0
2029+#: field:fashion.form.cost.rel.pricelist,value:0
2030+#: field:fashion.form.partner.rel,value:0
2031+msgid "Value"
2032+msgstr "Valore"
2033
2034 #. module: fashion
2035 #: view:fashion.form:0
2036@@ -588,16 +650,14 @@
2037 msgstr "Non obsoleto"
2038
2039 #. module: fashion
2040-#: help:fashion.form.fabric,test:0
2041-msgid "This fabric is used for a model testing, maybe it won't be produced!"
2042-msgstr ""
2043-"Questo tesstuo è utilizzato per un modello in prova, può anche non essere "
2044-"poi prodotto!"
2045+#: help:fashion.form,sum_accessory:0
2046+msgid "Sum of the accessory list (see page Accessory for details)"
2047+msgstr "Somma lista accessori (vedere la pagina accessori per il dettaglio"
2048
2049 #. module: fashion
2050-#: model:ir.ui.menu,name:fashion.menu_fashion_form_form_client
2051-msgid "Fowm with client"
2052-msgstr "Scheda con cliente"
2053+#: field:fashion.form.partner.rel,total_fabric:0
2054+msgid "Total fabric"
2055+msgstr "Totale tessuto"
2056
2057 #. module: fashion
2058 #: field:fashion.form,comment_rel_ids:0
2059@@ -605,9 +665,11 @@
2060 msgstr "Commenti"
2061
2062 #. module: fashion
2063-#: field:fashion.form,draw_image_a_small:0
2064-msgid "Small-sized image"
2065-msgstr "Immagine taglio piccolo"
2066+#: view:fashion.form:0 view:fashion.form.partner.rel:0
2067+#: field:fashion.form.partner.rel,partner_id:0
2068+#: model:ir.model,name:fashion.model_res_partner
2069+msgid "Partner"
2070+msgstr "Cliente"
2071
2072 #. module: fashion
2073 #: field:fashion.form,col_ref:0
2074@@ -651,6 +713,13 @@
2075 msgstr "Peso"
2076
2077 #. module: fashion
2078+#: help:fashion.form.fabric,test:0
2079+msgid "This fabric is used for a model testing, maybe it won't be produced!"
2080+msgstr ""
2081+"Questo tesstuo è utilizzato per un modello in prova, può anche non essere "
2082+"poi prodotto!"
2083+
2084+#. module: fashion
2085 #: view:fashion.form:0 field:fashion.form,draw_image_c:0
2086 #: field:fashion.form,draw_image_d:0
2087 msgid "Photo"
2088@@ -673,9 +742,9 @@
2089 msgstr "Simboli"
2090
2091 #. module: fashion
2092-#: field:fashion.form.measure.rel,visible:0
2093-msgid "Visible"
2094-msgstr "Visibile"
2095+#: view:fashion.form:0
2096+msgid "Company form"
2097+msgstr "Scheda aziendale"
2098
2099 #. module: fashion
2100 #: field:fashion.form,draw_image_a_medium:0
2101@@ -683,10 +752,9 @@
2102 msgstr "Immagine taglio medio"
2103
2104 #. module: fashion
2105-#: field:fashion.form.partner.rel,mt_fabric:0
2106-#: field:fashion.form.partner.rel,mt_lining:0
2107-msgid "Meters"
2108-msgstr "Metri"
2109+#: field:fashion.form.partner.rel,h_fabric:0
2110+msgid "H."
2111+msgstr "H."
2112
2113 #. module: fashion
2114 #: field:fashion.form,start:0 field:res.partner,start:0
2115@@ -710,9 +778,9 @@
2116 msgstr "Vecchio nome"
2117
2118 #. module: fashion
2119-#: field:fashion.form.partner.rel,lining_tot:0
2120-msgid "Total lining"
2121-msgstr "Totale fodera"
2122+#: help:fashion.form,sum_extra_cost:0
2123+msgid "Sum of accessory cost and cost list (no fabric in this total)"
2124+msgstr "Somma costi accessori e costi lista (il tessuto è escluso dal totale)"
2125
2126 #. module: fashion
2127 #: view:fashion.form:0 field:fashion.form,customer_code:0
2128@@ -726,6 +794,11 @@
2129 msgstr "Taglio"
2130
2131 #. module: fashion
2132+#: view:fashion.form:0
2133+msgid "Calculate"
2134+msgstr "Ricalcola"
2135+
2136+#. module: fashion
2137 #: field:fashion.form.accessory,gerber_char:0
2138 msgid "Gerber char"
2139 msgstr "Carattere (Gerber)"
2140@@ -777,8 +850,13 @@
2141
2142 #. module: fashion
2143 #: view:fashion.form:0
2144-msgid "Statistics"
2145-msgstr "Statistiche"
2146+msgid "Duplicate"
2147+msgstr "Duplica"
2148+
2149+#. module: fashion
2150+#: model:ir.ui.menu,name:fashion.menu_fashion_form_form_client
2151+msgid "Form with client"
2152+msgstr "Scheda con clienti"
2153
2154 #. module: fashion
2155 #: view:fashion.form:0 selection:fashion.form,state:0
2156@@ -846,6 +924,11 @@
2157 msgstr "Col3"
2158
2159 #. module: fashion
2160+#: view:fashion.form:0
2161+msgid "Cost model"
2162+msgstr "Costi gestiti"
2163+
2164+#. module: fashion
2165 #: selection:fashion.form.characteristic.rel.specific,type:0
2166 msgid "Col1"
2167 msgstr "Col1"
2168@@ -877,12 +960,16 @@
2169
2170 #. module: fashion
2171 #: field:fashion.form.accessory.rel,tot_cost:0
2172-#: field:fashion.form.partner.rel,cost_tot:0
2173-#: field:fashion.form.partner.rel,tot_cost:0
2174+#: field:fashion.form.partner.rel,total_cost:0
2175 msgid "Total cost"
2176 msgstr "Costo totale"
2177
2178 #. module: fashion
2179+#: model:ir.actions.act_window,name:fashion.action_fashion_form_cost
2180+msgid "Fashion form cost"
2181+msgstr "Scheda costi"
2182+
2183+#. module: fashion
2184 #: selection:fashion.report.wizard,type:0
2185 msgid "B - Scheda Commerciale"
2186 msgstr "B - Scheda Commerciale"
2187@@ -897,6 +984,7 @@
2188 #: field:fashion.form.characteristic.rel.specific,access_id:0
2189 #: field:fashion.form.comment.rel,access_id:0
2190 #: field:fashion.form.cost,access_id:0 field:fashion.form.cost.rel,access_id:0
2191+#: field:fashion.form.cost.rel.pricelist,access_id:0
2192 #: field:fashion.form.fabric,access_id:0
2193 #: field:fashion.form.measure,access_id:0
2194 #: field:fashion.form.measure.rel,access_id:0
2195@@ -929,12 +1017,9 @@
2196 msgstr "Metri fodera"
2197
2198 #. module: fashion
2199-#: field:fashion.form.accessory.rel,sequence:0
2200-#: field:fashion.form.characteristic.rel,sequence:0
2201-#: field:fashion.form.measure.rel,sequence:0
2202-#: field:fashion.form.stitch.rel,sequence:0
2203-msgid "Seq."
2204-msgstr "Seq."
2205+#: field:fashion.form.partner.rel,retail:0
2206+msgid "Retail"
2207+msgstr "Dettaglio"
2208
2209 #. module: fashion
2210 #: model:res.groups,name:fashion.group_fashion_admin
2211@@ -947,9 +1032,14 @@
2212 msgstr "Tg.2"
2213
2214 #. module: fashion
2215-#: field:fashion.form.measure.rel,size_11:0
2216-msgid "Size 11"
2217-msgstr "Tg.11"
2218+#: field:fashion.form.cost,default:0
2219+msgid "Default"
2220+msgstr "Predefinito"
2221+
2222+#. module: fashion
2223+#: view:fashion.form:0
2224+msgid "Production info"
2225+msgstr "Info produzione"
2226
2227 #. module: fashion
2228 #: model:ir.actions.act_window,name:fashion.action_fashion_form_measure
2229@@ -969,7 +1059,7 @@
2230 #. module: fashion
2231 #: field:fashion.report.wizard,summary:0
2232 msgid "Summary"
2233-msgstr "Ripilogo"
2234+msgstr "Riepilogo"
2235
2236 #. module: fashion
2237 #: view:fashion.form:0 field:fashion.form,date:0
2238@@ -999,14 +1089,14 @@
2239 msgstr "Errore"
2240
2241 #. module: fashion
2242-#: view:fashion.form:0
2243-msgid "Gerber"
2244-msgstr "Gerber"
2245+#: field:fashion.form.partner.rel,margin_note:0
2246+msgid "Balance"
2247+msgstr "Balance"
2248
2249 #. module: fashion
2250-#: model:ir.model,name:fashion.model_fashion_form
2251-msgid "fashion.form"
2252-msgstr "Schede modelli"
2253+#: model:ir.ui.menu,name:fashion.menu_fashion_configuration_cost_fixed
2254+msgid "Cost (fixed)"
2255+msgstr "Costi"
2256
2257 #. module: fashion
2258 #: field:fashion.form,original:0
2259@@ -1070,13 +1160,17 @@
2260 #: field:fashion.form.accessory,sequence:0
2261 #: field:fashion.form.characteristic,sequence:0
2262 #: field:fashion.form.cost,sequence:0 field:fashion.form.stitch,sequence:0
2263+#: field:fashion.season,sequence:0
2264 msgid "Sequence"
2265 msgstr "Sequenza"
2266
2267 #. module: fashion
2268+#: field:fashion.form,sum_cost:0
2269+msgid "Total cost list"
2270+msgstr "Totale lista costi"
2271+
2272+#. module: fashion
2273 #: field:fashion.form.partner.rel,gerber_h:0
2274-#: field:fashion.form.partner.rel,h_fabric:0
2275-#: field:fashion.form.partner.rel,h_lining:0
2276 msgid "Height"
2277 msgstr "Altezza"
2278
2279@@ -1086,7 +1180,7 @@
2280 msgstr "Utente che ha aggiunto il commento"
2281
2282 #. module: fashion
2283-#: code:addons/fashion/fashion.py:414 field:fashion.form.measure.rel,header:0
2284+#: code:addons/fashion/fashion.py:460 field:fashion.form.measure.rel,header:0
2285 #, python-format
2286 msgid "Header"
2287 msgstr "Intestazione"
2288@@ -1121,6 +1215,8 @@
2289
2290 #. module: fashion
2291 #: view:fashion.form.fabric:0 field:fashion.form.fabric,test:0
2292+#: model:ir.actions.act_window,name:fashion.action_fashion_form_fabric_test
2293+#: model:ir.ui.menu,name:fashion.menu_fashion_configuration_fabric_test
2294 msgid "Test fabric"
2295 msgstr "Tessuto di prova"
2296
2297@@ -1144,6 +1240,11 @@
2298 msgstr "Altezza fodera"
2299
2300 #. module: fashion
2301+#: help:fashion.form.partner.rel,access_2_id:0
2302+msgid "ID Importazione che tiene il link con partner costi"
2303+msgstr "ID Importazione che tiene il link con partner costi"
2304+
2305+#. module: fashion
2306 #: model:ir.actions.act_window,name:fashion.action_fashion_form_characteristic
2307 msgid "Fashion characteristic"
2308 msgstr "Caratteristica"
2309@@ -1199,6 +1300,11 @@
2310 msgstr "Disegno lato B"
2311
2312 #. module: fashion
2313+#: field:fashion.form.cost.rel.pricelist,current:0
2314+msgid "Current"
2315+msgstr "Attuale"
2316+
2317+#. module: fashion
2318 #: field:fashion.form,model_article:0
2319 #: field:fashion.form.partner.rel,model_article:0
2320 msgid "Sigla articolo"
2321@@ -1230,6 +1336,14 @@
2322 msgstr "Composizione"
2323
2324 #. module: fashion
2325+#: field:fashion.form.accessory.rel,sequence:0
2326+#: field:fashion.form.characteristic.rel,sequence:0
2327+#: field:fashion.form.measure.rel,sequence:0
2328+#: field:fashion.form.stitch.rel,sequence:0
2329+msgid "Seq."
2330+msgstr "Seq."
2331+
2332+#. module: fashion
2333 #: field:fashion.form.measure.rel,real:0
2334 msgid "Real"
2335 msgstr "Riscontrato"
2336@@ -1245,6 +1359,11 @@
2337 msgstr "Codice cliente"
2338
2339 #. module: fashion
2340+#: view:fashion.form.characteristic.rel.specific:0
2341+msgid "Terms"
2342+msgstr "Termini"
2343+
2344+#. module: fashion
2345 #: view:fashion.form:0 field:fashion.form.accessory.rel,name:0
2346 #: field:fashion.form.characteristic.rel,name:0
2347 #: field:fashion.form.characteristic.rel.specific,name:0
2348@@ -1271,6 +1390,11 @@
2349 "image is required."
2350
2351 #. module: fashion
2352+#: help:fashion.form.partner.rel,cost:0
2353+msgid "Unit price for fabric"
2354+msgstr "Prezzo unitario per tessuto"
2355+
2356+#. module: fashion
2357 #: field:fashion.form,size:0
2358 msgid "Sizes"
2359 msgstr "Taglia"
2360@@ -1303,9 +1427,9 @@
2361 msgstr "col 9"
2362
2363 #. module: fashion
2364-#: selection:fashion.form,col_ref:0
2365-msgid "col 8"
2366-msgstr "col 8"
2367+#: view:fashion.form:0 field:fashion.form,model_for_cost:0
2368+msgid "Model for cost"
2369+msgstr "Modello per listino"
2370
2371 #. module: fashion
2372 #: help:fashion.form,draw_image_a:0
2373@@ -1322,6 +1446,11 @@
2374 msgstr "Riga intestazione"
2375
2376 #. module: fashion
2377+#: field:fashion.form.partner.rel,wholesale:0
2378+msgid "Wholesale"
2379+msgstr "Ingrosso"
2380+
2381+#. module: fashion
2382 #: field:fashion.form,cost_rel_ids:0
2383 msgid "Cost Relation"
2384 msgstr "Costi"
2385@@ -1368,6 +1497,11 @@
2386 msgstr "Inserisci"
2387
2388 #. module: fashion
2389+#: model:ir.ui.menu,name:fashion.menu_fashion_form_form_cost
2390+msgid "Form for cost"
2391+msgstr "Scheda costi"
2392+
2393+#. module: fashion
2394 #: field:fashion.article,name:0 field:fashion.form.accessory,name:0
2395 #: field:fashion.form.characteristic,name:0 field:fashion.form.cost,name:0
2396 #: field:fashion.form.partner.rel,gerber_name:0
2397@@ -1377,11 +1511,6 @@
2398 msgstr "Nome"
2399
2400 #. module: fashion
2401-#: field:fashion.form.partner.rel,detail:0
2402-msgid "Detail percentage"
2403-msgstr "% Dettaglio"
2404-
2405-#. module: fashion
2406 #: model:ir.actions.act_window,name:fashion.action_fashion_form_fabric
2407 msgid "Fashion fabric"
2408 msgstr "Tessuto"
2409@@ -1399,6 +1528,11 @@
2410 "il nome"
2411
2412 #. module: fashion
2413+#: model:ir.module.category,description:fashion.module_fashion
2414+msgid "Manage fashion groups."
2415+msgstr "Gestisci gruppi amministrazione."
2416+
2417+#. module: fashion
2418 #: model:ir.model,name:fashion.model_fashion_form_characteristic_rel_specific
2419 msgid "Specific"
2420 msgstr "Specifica"
2421@@ -1424,6 +1558,11 @@
2422 msgstr "Produzione"
2423
2424 #. module: fashion
2425+#: field:fashion.form.partner.rel,access_2_id:0
2426+msgid "Access 2 ID"
2427+msgstr "Access 2 ID"
2428+
2429+#. module: fashion
2430 #: view:fashion.form:0
2431 msgid "Ok for Production"
2432 msgstr "OK produrre"
2433@@ -1439,6 +1578,11 @@
2434 msgstr "Codice articolo tessuto"
2435
2436 #. module: fashion
2437+#: field:fashion.form.partner.rel,note_cost:0
2438+msgid "Cost note"
2439+msgstr "Note costo"
2440+
2441+#. module: fashion
2442 #: selection:fashion.duplication,duplication:0
2443 msgid "New Revision"
2444 msgstr "Nuova revisione"
2445@@ -1490,7 +1634,7 @@
2446 msgstr "Lunghezza (Gerber)"
2447
2448 #. module: fashion
2449-#: model:ir.actions.act_window,name:fashion.action_fashion_form_cost
2450+#: model:ir.actions.act_window,name:fashion.action_fashion_form_cost_fixed
2451 msgid "Fashion cost"
2452 msgstr "Costo"
2453
2454@@ -1500,18 +1644,13 @@
2455 msgstr "Scheda duplicata"
2456
2457 #. module: fashion
2458-#: view:fashion.form:0
2459-msgid "H. fod."
2460-msgstr "H. fod."
2461-
2462-#. module: fashion
2463-#: field:fashion.form.accessory.pricelist,cost:0
2464+#: view:fashion.form:0 field:fashion.form.accessory.pricelist,cost:0
2465 #: field:fashion.form.accessory.rel,currency:0 view:fashion.form.cost:0
2466-#: field:fashion.form.cost.rel,cost_id:0 field:fashion.form.fabric,cost:0
2467-#: field:fashion.form.partner.rel,cost:0
2468+#: field:fashion.form.cost,cost:0 field:fashion.form.cost.rel,cost_id:0
2469+#: field:fashion.form.cost.rel.pricelist,cost_rel_id:0
2470+#: field:fashion.form.fabric,cost:0 field:fashion.form.partner.rel,cost:0
2471 #: field:fashion.form.partner.rel,cost_id:0
2472 #: model:ir.model,name:fashion.model_fashion_form_cost
2473-#: model:ir.ui.menu,name:fashion.menu_fashion_configuration_cost
2474 msgid "Cost"
2475 msgstr "Costo"
2476
2477@@ -1526,6 +1665,11 @@
2478 msgstr "Cucitura"
2479
2480 #. module: fashion
2481+#: field:fashion.form,draw_image_a_small:0
2482+msgid "Small-sized image"
2483+msgstr "Immagine taglio piccolo"
2484+
2485+#. module: fashion
2486 #: field:fashion.form,accessory_rel_ids:0
2487 msgid "Accessory Relation"
2488 msgstr "Accessori"
2489
2490=== removed file 'fashion/report/form_Aq.odt'
2491Binary files fashion/report/form_Aq.odt 2014-03-21 09:20:38 +0000 and fashion/report/form_Aq.odt 1970-01-01 00:00:00 +0000 differ
2492=== added file 'fashion/report/form_B.odt.OTHER'
2493Binary files fashion/report/form_B.odt.OTHER 1970-01-01 00:00:00 +0000 and fashion/report/form_B.odt.OTHER 2014-09-17 15:12:42 +0000 differ
2494=== modified file 'fashion/security/ir.model.access.csv'
2495--- fashion/security/ir.model.access.csv 2014-03-17 16:29:06 +0000
2496+++ fashion/security/ir.model.access.csv 2014-09-17 15:12:42 +0000
2497@@ -7,7 +7,7 @@
2498 "access_fashion_form_characteristic_rel_user","fashion.form.characteristic.rel","model_fashion_form_characteristic_rel","base.group_user",1,1,1,1
2499 "access_fashion_form_characteristic_user","fashion.form.characteristic","model_fashion_form_characteristic","base.group_user",1,1,1,1
2500 "access_fashion_form_characteristic_rel_specific_user","fashion.form.characteristic.rel.specific","model_fashion_form_characteristic_rel_specific","base.group_user",1,1,1,1
2501-"access_fashion_form_comment_rel_user","fashion.form.comment.rel","model_fashion_form_comment_rel","base.group_user",1,1,1,0
2502+"access_fashion_form_comment_rel_user","fashion.form.comment.rel","model_fashion_form_comment_rel","base.group_user",1,1,1,1
2503 "access_fashion_form_cost_user","fashion.form.cost","model_fashion_form_cost","base.group_user",1,1,1,1
2504 "access_fashion_form_fabric_user","fashion.form.fabric","model_fashion_form_fabric","base.group_user",1,1,1,1
2505 "access_fashion_form_measure_user","fashion.form.measure","model_fashion_form_measure","base.group_user",1,1,1,1
2506@@ -18,4 +18,4 @@
2507 "access_fashion_form_user","fashion.form","model_fashion_form","base.group_user",1,1,1,1
2508 "access_fashion_measure_rel_user","fashion.measure.rel","model_fashion_measure_rel","base.group_user",1,1,1,1
2509 "access_fashion_form_cost_rel_user","fashion.form.cost.rel","model_fashion_form_cost_rel","base.group_user",1,1,1,1
2510-
2511+"access_fashion_form_cost_rel_pricelist_user","fashion.form.cost.rel.pricelist","model_fashion_form_cost_rel_pricelist","base.group_user",1,1,1,1
2512
2513=== modified file 'fashion/wizard/duplication_fashion.py'
2514--- fashion/wizard/duplication_fashion.py 2014-09-17 14:31:39 +0000
2515+++ fashion/wizard/duplication_fashion.py 2014-09-17 15:12:42 +0000
2516@@ -40,18 +40,19 @@
2517 form_id = context.get('active_id')
2518 if form_id:
2519 form_proxy = self.pool.get('fashion.form').browse(cr, uid, form_id, context=context)
2520- start = int(form_proxy.start or '0')
2521- size_base = int(form_proxy.size_base or '0')
2522- if not start: # default start
2523- start = 40
2524- col_ref = 1 + (size_base - start) / 2
2525- if col_ref != form_proxy.col_ref:
2526- res = "Non conforme la gestione colonne:\nColonna base: %s\nColonna di partenza: %s\nColonna di riferimento: %s\nValore corretto %s (reimpostarlo e poi duplicare)\n" % (
2527- size_base,
2528- start,
2529- form_proxy.col_ref,
2530- col_ref,
2531- )
2532+ if form_proxy.old_model: # test only old models
2533+ start = int(form_proxy.start or '0')
2534+ size_base = int(form_proxy.size_base or '0')
2535+ if not start: # default start # TODO testare meglio l'errore se manca start
2536+ start = 40
2537+ col_ref = 1 + (size_base - start) / 2
2538+ if col_ref != form_proxy.col_ref:
2539+ res = "Non conforme la gestione colonne:\nColonna base: %s\nColonna di partenza: %s\nColonna di riferimento: %s\nValore corretto %s (reimpostarlo e poi duplicare)\n" % (
2540+ size_base,
2541+ start,
2542+ form_proxy.col_ref,
2543+ col_ref,
2544+ )
2545 return res
2546
2547 _columns = {
2548@@ -102,6 +103,7 @@
2549
2550 data = {
2551 'model': model,
2552+ # extra model elements calculated during create / write
2553 'size_base': form_proxy.size_base,
2554 'size_measure': form_proxy.size_measure,
2555 'review': review,
2556@@ -130,7 +132,7 @@
2557 'col_ref': 3,
2558
2559 'old_model': False, # New duplication became new model, problem: col_ref not 2
2560- }
2561+ }
2562 form_id = form_pool.create(cr, uid, data, context=context)
2563
2564 # one2many fields:
2565@@ -148,12 +150,8 @@
2566 'weight': item.weight,
2567 'h_fabric': item.h_fabric,
2568 'mt_fabric': item.mt_fabric,
2569- 'detail': item.detail,
2570 'wholesale': item.wholesale,
2571- 'department_store': item.department_store,
2572 'note_fabric': item.note_fabric,
2573- 'h_lining': item.h_lining,
2574- 'mt_lining': item.mt_lining,
2575 'h_fabric': item.h_fabric,
2576 'cost': item.cost,
2577 'h_fabric': item.h_fabric,
2578@@ -161,17 +159,22 @@
2579 'gerber_l': item.gerber_l,
2580 'gerber_h': item.gerber_h,
2581 'gerber_desc': item.gerber_desc,
2582- 'cost_tot': item.cost_tot,
2583- 'fabric_tot': item.fabric_tot,
2584- 'lining_tot': item.lining_tot,
2585- 'tot_cost': item.tot_cost,
2586 'perc_reload': item.perc_reload,
2587 'perc_margin': item.perc_margin,
2588 'sale': item.sale,
2589 'supplier_id': item.supplier_id.id,
2590 'article_code': item.article_code,
2591-
2592+
2593 'form_id': form_id,
2594+
2595+ #'detail': item.detail,
2596+ #'department_store': item.department_store,
2597+ #'h_lining': item.h_lining,
2598+ #'mt_lining': item.mt_lining,
2599+ #'cost_tot': item.cost_tot,
2600+ #'fabric_tot': item.fabric_tot,
2601+ #'lining_tot': item.lining_tot,
2602+ #'tot_cost': item.tot_cost,
2603 }, context=context)
2604
2605 # Characteristic:
2606@@ -221,6 +224,7 @@
2607 'currency': item.currency,
2608 'tot_cost': item.tot_cost,
2609 'color': item.color,
2610+ 'note': item.note,
2611 'gerber_name': item.gerber_name,
2612 'gerber_desc': item.gerber_desc,
2613 'gerber_h': item.gerber_h,
2614@@ -274,5 +278,4 @@
2615 'type': 'ir.actions.act_window',
2616 'res_id': form_id, # IDs selected
2617 }
2618-
2619 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2620
2621=== modified file 'fashion/wizard/report_wizard.py'
2622--- fashion/wizard/report_wizard.py 2014-09-17 14:31:39 +0000
2623+++ fashion/wizard/report_wizard.py 2014-09-17 15:12:42 +0000
2624@@ -46,7 +46,7 @@
2625 '''
2626 res = {}
2627 res['value'] = {}
2628- res['value']['summary'] = False #report_type == 'a'
2629+ res['value']['summary'] = report_type == 'a' # True only for A
2630 return res
2631
2632 _columns = {
2633@@ -69,7 +69,7 @@
2634 _defaults = {
2635 'type': 'a',
2636 'form_id': lambda s,cr,uid,ctx: s.get_form_id(cr, uid, ctx),
2637- 'summary': False,
2638+ 'summary': True,
2639 'total': False,
2640 'image': True,
2641 'partner_fabric_id': lambda s,cr,uid,ctx: s.get_partner_fabric_id(cr, uid, ctx),
2642
2643=== modified file 'fashion/wizard/report_wizard.xml'
2644--- fashion/wizard/report_wizard.xml 2014-03-17 11:48:32 +0000
2645+++ fashion/wizard/report_wizard.xml 2014-09-17 15:12:42 +0000
2646@@ -11,7 +11,7 @@
2647 <sheet>
2648 <group col='4'>
2649 <field name="type" on_change="onchange_type(type)"/>
2650- <field name="partner_fabric_id" attrs="{'invisible':[('type','=','c'),'&amp;',('type','=','a'),('summary','=',True)],'required':['|',('type','in',['b','e']),'&amp;',('type','=','a'),('summary','=',False)]}" domain="[('form_id','=',form_id)]"/> <!--'required':[('type','in',['b','d','e'])]-->
2651+ <field name="partner_fabric_id" attrs="{'invisible':[('type','=','c'),'&amp;',('type','=','a'),('summary','=',True)],'required':['|',('type','in',['b','d','e']),'&amp;',('type','=','a'),('summary','=',False)]}" domain="[('form_id','=',form_id)]"/> <!--'required':[('type','in',['b','d','e'])]-->
2652 <!--<field name="prototipe" attrs="{'invisible':[('duplication','=','version')], 'required':[('duplication','=','form')]}"/>-->
2653 <field name="form_id" invisible='1'/>
2654 <newline/>

Subscribers

People subscribed via source and target branches