427
446
'package_and_forwording': fields.float('Packing & Forwarding', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
428
447
'insurance': fields.float('Insurance', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
429
448
'commission': fields.float('Commission', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
430
'delivey': fields.char('Ex. GoDown / Mill Delivey',size=50, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
449
'delivey': fields.many2one('purchase.delivery', 'Ex. GoDown / Mill Delivey', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
431
450
'po_series_id': fields.many2one('product.order.series', 'Series', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
432
451
'amount_untaxed': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Untaxed Amount',
434
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
453
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['service_ids','other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
435
454
'purchase.order.line': (_get_order, None, 10),
436
455
}, multi="sums", help="The amount without tax", track_visibility='always'),
437
456
'amount_tax': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Taxes',
439
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
458
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['service_ids','other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
440
459
'purchase.order.line': (_get_order, None, 10),
441
460
}, multi="sums", help="The tax amount"),
442
461
'amount_total': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Total',
444
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
463
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['service_ids','other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
445
464
'purchase.order.line': (_get_order, None, 10),
446
465
}, multi="sums",help="The total amount"),
447
466
'other_charges': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Other Charges',
449
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
468
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['service_ids','other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
450
469
'purchase.order.line': (_get_order, None, 10),
451
470
}, multi="sums",help="Other Charges(computed as Packing & Forwarding - (Commission + Other Discount))"),
452
471
'excise_amount': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Excise Amount',
454
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
473
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['service_ids','other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
455
474
'purchase.order.line': (_get_order, None, 10),
456
475
}, multi="sums",help="The total excise amount"),
457
476
'excise_total': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Excise Total',
459
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
478
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['service_ids','other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
460
479
'purchase.order.line': (_get_order, None, 10),
461
480
}, multi="sums",help="The total after excise"),
462
481
'vat_amount': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='VAT Amount',
464
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
483
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['service_ids','other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
465
484
'purchase.order.line': (_get_order, None, 10),
466
485
}, multi="sums",help="The total VAT amount"),
467
486
'vat_total': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='VAT Total',
469
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
488
'purchase.order': (lambda self, cr, uid, ids, c={}: ids, ['service_ids','other_tax_ids','excies_ids', 'vat_ids', 'insurance', 'insurance_type', 'freight_type','freight','packing_type','package_and_forwording','commission','other_discount', 'discount_percentage', 'order_line'], 10),
470
489
'purchase.order.line': (_get_order, None, 10),
471
490
}, multi="sums",help="The total after VAT"),
472
491
'excies_ids': fields.many2many('account.tax', 'purchase_order_exices', 'exices_id', 'tax_id', 'Excise', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
937
968
res[move.id]['indent_year'] = indent_year
971
def _get_stock(self, cr, uid, ids, name, args, context=None):
973
product_obj = self.pool.get('product.product')
974
for move in self.browse(cr, uid, ids, context=context):
975
product = product_obj.browse(cr, uid, [move.product_id.id])[0]
976
res[move.id] = product and product.qty_available or 0.0
940
979
def _get_today(self,cr, uid, ids, name, args, context=None):
942
981
for move in self.browse(cr, uid, ids, context=context):
943
982
res[move.id] = time.strftime('%d/%m/%Y')
985
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
987
@ Set Challan_qty String on the base of picking type
989
context = context or {}
990
res = super(stock_move, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
991
eview = etree.fromstring(res['arch'])
992
node = eview.xpath("//field[@name='challan_qty']") and eview.xpath("//field[@name='challan_qty']")[0]
993
if context.get('picking_type') == 'internal':
994
if 'challan_qty' in res['fields'].keys():
995
node.set('string', _('Issue Quantity'))
996
if context.get('picking_type') == 'out' and node in eview:
997
location = eview.xpath("//field[@name='location_id']") and eview.xpath("//field[@name='location_id']")[0]
998
location.set('modifiers', '{"invisible":false}')
1000
if context.get('picking_type') == 'internal':
1001
stock = eview.xpath("//field[@name='qty_available']") and eview.xpath("//field[@name='qty_available']")[0]
1002
stock.set('modifiers', '{"invisible":false,"readonly":true}')
1003
res['arch'] = etree.tostring(eview)
947
1007
'type': fields.related('picking_id', 'type', type='selection', selection=[('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'),('receipt', 'receipt')], string='Shipping Type',store=True),
948
1008
'rate': fields.float('Rate', digits_compute= dp.get_precision('Account'), help="Rate for the product which is related to Purchase order"),