Merge lp:~openerp-india/openerp-india/trunk-nco into lp:openerp-india

Proposed by Nimesh Contractor(Open ERP)
Status: Merged
Merge reported by: Atul Patel(OpenERP)
Merged at revision: not available
Proposed branch: lp:~openerp-india/openerp-india/trunk-nco
Merge into: lp:openerp-india
Diff against target: 1638 lines (+649/-211)
10 files modified
l10n_in_tax_retail_invoice/__openerp__.py (+4/-0)
l10n_in_tax_retail_invoice/l10n_in_tax_retail_invoice.py (+202/-139)
l10n_in_tax_retail_invoice/report/purchase_order.py (+1/-1)
l10n_in_tax_retail_invoice/report/quotation.py (+1/-1)
l10n_in_tax_retail_invoice/report/sale_order_tax.py (+1/-1)
l10n_in_tax_retail_invoice/report/sale_order_tax.rml (+8/-8)
l10n_in_tax_retail_invoice/report/tax_invoice.py (+1/-1)
l10n_in_tax_retail_invoice/report/tax_invoice.rml (+320/-60)
l10n_in_tax_retail_invoice/test/purchase_order.yml (+42/-0)
l10n_in_tax_retail_invoice/test/sale_order.yml (+69/-0)
To merge this branch: bzr merge lp:~openerp-india/openerp-india/trunk-nco
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) Pending
Review via email: mp+170580@code.launchpad.net

This proposal supersedes a proposal from 2013-06-19.

Description of the change

Hello,

I have removed unused protal changes.

Thank You.
Nimesh.

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote : Posted in a previous version of this proposal

Make clean diff currently it is showing changes on portal also..

Thanks,

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'l10n_in_tax_retail_invoice/__openerp__.py'
--- l10n_in_tax_retail_invoice/__openerp__.py 2013-05-23 08:40:28 +0000
+++ l10n_in_tax_retail_invoice/__openerp__.py 2013-06-20 10:57:25 +0000
@@ -53,6 +53,10 @@
53 'l10n_in_tax_retail_invoice_view.xml',53 'l10n_in_tax_retail_invoice_view.xml',
54 'res_config_view.xml',54 'res_config_view.xml',
55 ],55 ],
56 'test':[
57 'test/purchase_order.yml',
58 'test/sale_order.yml',
59 ],
56 'installable': True,60 'installable': True,
57 'auto_install': False,61 'auto_install': False,
58}62}
5963
=== modified file 'l10n_in_tax_retail_invoice/l10n_in_tax_retail_invoice.py'
--- l10n_in_tax_retail_invoice/l10n_in_tax_retail_invoice.py 2013-05-23 08:40:28 +0000
+++ l10n_in_tax_retail_invoice/l10n_in_tax_retail_invoice.py 2013-06-20 10:57:25 +0000
@@ -23,7 +23,7 @@
23from lxml import etree23from lxml import etree
2424
25from openerp.osv import fields, osv25from openerp.osv import fields, osv
26from tools.amount_to_text_en import amount_to_text26from openerp.tools.amount_to_text_en import amount_to_text
27from openerp.tools.translate import _27from openerp.tools.translate import _
28from openerp import netsvc28from openerp import netsvc
29import openerp.addons.decimal_precision as dp29import openerp.addons.decimal_precision as dp
@@ -42,17 +42,20 @@
42 _inherit = "product.product"42 _inherit = "product.product"
43 43
44 def _check_packing_cost_allowed(self, cr, uid, ids, name, args, context=None):44 def _check_packing_cost_allowed(self, cr, uid, ids, name, args, context=None):
45 '''
46 This function allows us to use Packing Cost Features.
47
48 :param ids: list of product record ids.
49 :param name : browse name fields of packing_cost_allowed
50 :returns: True or False value of Packing Cost of company.
51 :rtype: dict
52 '''
45 res = {}53 res = {}
46 res_company = self.pool.get('res.company')54 res_company = self.pool.get('res.company')
47 for id in ids:55 for id in ids:
48 packing_cost_allowed = res_company.browse(cr, uid, uid, context=context).packing_cost56 res[id] = res_company.browse(cr, uid, uid, context=context).packing_cost
49 res[id] = packing_cost_allowed57 return res
50 return res
51 58
52 def _default_check_packing_cost_allowed(self, cr, uid, ids, context=None):
53 res_company = self.pool.get('res.company')
54 packing_cost_allowed = res_company.browse(cr, uid, uid, context=context).packing_cost
55 return packing_cost_allowed
56 59
57 _columns = {60 _columns = {
58 'packing_cost_type': fields.selection([61 'packing_cost_type': fields.selection([
@@ -65,26 +68,27 @@
65 }68 }
66 69
67 _defaults = {70 _defaults = {
68 'packing_cost_allowed': _default_check_packing_cost_allowed,71 'packing_cost_allowed': lambda self, cr, uid, context: self.pool.get('res.company').browse(cr, uid, uid, context=context).packing_cost,
69 'packing_cost_type': 'percentage',72 'packing_cost_type': 'percentage',
70 }73 }
71 74
72class res_partner(osv.osv):75class res_partner(osv.osv):
73 76
74 _inherit = "res.partner"77 _inherit = "res.partner"
75 78
76 def _check_dealers_discount_allowed(self, cr, uid, ids, name, args, context=None):79 def _check_dealers_discount_allowed(self, cr, uid, ids, name, args, context=None):
80 '''
81 This function allows us to use dealers discount feature.
82
83 :param ids: list of partner record ids.
84 :returns: True or False value of dealers discount of company
85 :rtype: dict of true and false value
86 '''
77 res = {}87 res = {}
78 res_company = self.pool.get('res.company')88 res_company = self.pool.get('res.company')
79 for id in ids:89 for id in ids:
80 dealers_discount_allowed = res_company.browse(cr, uid, uid, context=context).dealers_discount90 res[id] = res_company.browse(cr, uid, uid, context=context).dealers_discount
81 res[id] = dealers_discount_allowed91 return res
82 return res
83
84 def _default_check_dealers_discount_allowed(self, cr, uid, ids, context=None):
85 res_company = self.pool.get('res.company')
86 dealers_discount_allowed = res_company.browse(cr, uid, uid, context=context).dealers_discount
87 return dealers_discount_allowed
88 92
89 _columns = {93 _columns = {
90 'tin_no' : fields.char('TIN', size=32, help="Tax Identification Number"),94 'tin_no' : fields.char('TIN', size=32, help="Tax Identification Number"),
@@ -98,9 +102,12 @@
98 }102 }
99 103
100 _defaults = {104 _defaults = {
101 'dealers_discount_allowed': _default_check_dealers_discount_allowed,105 'dealers_discount_allowed': lambda self, cr, uid, context: self.pool.get('res.company').browse(cr, uid, uid, context=context).dealers_discount,
102 }106 }
103 def _check_recursion(self, cr, uid, ids, context=None):107 def _check_recursion(self, cr, uid, ids, context=None):
108 """
109 Set constraints to cannot create recursive dealers.
110 """
104 level = 100111 level = 100
105 while len(ids):112 while len(ids):
106 cr.execute('select distinct dealer_id from res_partner where id IN %s',(tuple(ids),))113 cr.execute('select distinct dealer_id from res_partner where id IN %s',(tuple(ids),))
@@ -151,17 +158,34 @@
151 158
152 _inherit = "sale.order"159 _inherit = "sale.order"
153 160
154 def _get_pack_total(self, cursor, user, ids, name, arg, context=None):161 def _get_pack_total(self, cr, uid, ids, name, arg, context=None):
162 '''
163 The purpose of this function is to build and return packing_total and dealers_disc
164 :param ids: list of sale order ids
165 :returns: packing_total and dealers_disc
166 :rtype: dictionary
167 '''
155 res = {}168 res = {}
156 tot_diff = 0.0169 for sale in self.browse(cr, uid, ids, context=context):
157 for sale in self.browse(cursor, user, ids, context=context):170 res[sale.id] = {
158 tot_diff = 0.0171 'packing_total': 0.0,
172 'dealers_disc': 0.0,
173 }
174 packing_total = dealers_disc = 0.0
159 for line in sale.order_line:175 for line in sale.order_line:
160 tot_diff += line.packing_amount # Need to check if packing cost apply by qty sold? 176 if line.lst_price:
161 res[sale.id] = tot_diff177 dealers_disc += (line.price_unit - line.lst_price) * line.product_uom_qty
178 packing_total += line.packing_amount # Need to check if packing cost apply by qty sold?
179 res[sale.id]['packing_total'] = packing_total
180 res[sale.id]['dealers_disc'] = dealers_disc
162 return res181 return res
182
163 183
164 def copy(self, cr, uid, id, default=None, context=None):184 def copy(self, cr, uid, id, default=None, context=None):
185 """
186 override orm copy method.
187 cannot duplicate invoice for sale order.
188 """
165 default = default or {}189 default = default or {}
166 default.update({190 default.update({
167 'invoice_id':False,191 'invoice_id':False,
@@ -169,8 +193,13 @@
169 return super(sale_order, self).copy(cr, uid, id, default, context=context)193 return super(sale_order, self).copy(cr, uid, id, default, context=context)
170 194
171 def _amount_line_tax(self, cr, uid, line, context=None):195 def _amount_line_tax(self, cr, uid, line, context=None):
172 sale_order_line_obj = self.pool.get('sale.order.line')196 '''
173 packing_cost_allowed = sale_order_line_obj.browse(cr, uid, line.id, context=context).order_id.company_id.packing_cost197 The purpose of this function is calculate amount with tax
198 :param line: browse the record of sale.order.line
199 :returns: amount val
200 :rtype: int
201 '''
202 packing_cost_allowed = self.pool.get('sale.order.line').browse(cr, uid, line.id, context=context).order_id.company_id.packing_cost
174 if packing_cost_allowed:203 if packing_cost_allowed:
175 val = 0.0204 val = 0.0
176 for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, (line.price_unit + line.packing_amount) * (1 - (line.discount or 0.0) / 100.0), line.product_uom_qty, line.product_id, line.order_id.partner_id)['taxes']:205 for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, (line.price_unit + line.packing_amount) * (1 - (line.discount or 0.0) / 100.0), line.product_uom_qty, line.product_id, line.order_id.partner_id)['taxes']:
@@ -179,25 +208,25 @@
179 return super(sale_order, self)._amount_line_tax(cr, uid, line, context=context)208 return super(sale_order, self)._amount_line_tax(cr, uid, line, context=context)
180 209
181 def _amount_all(self, cr, uid, ids, field_name, arg, context=None):210 def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
211 '''
212 The purpose of this function is Calculate a amount, untaxed and tax
213 :param ids: list of sale order record ids.
214 :returns: amount_total, amount_untaxed,amount_tax
215 :rtype: dictionary
216 '''
182 res = super(sale_order, self)._amount_all(cr, uid, ids, field_name, arg, context=context)217 res = super(sale_order, self)._amount_all(cr, uid, ids, field_name, arg, context=context)
183 return res218 return res
184 219
185 def _get_order(self, cr, uid, ids, context=None):220 def _get_order(self, cr, uid, ids, context=None):
221 '''
222 The purpose of this function to reculate amount total.
223 :param ids: list of sale order line record ids
224 :returns: Recalculated sale order id
225 :rtype: int
226 '''
186 res = super(sale_order, self.pool.get('sale.order'))._get_order(cr, uid, ids, context=context)227 res = super(sale_order, self.pool.get('sale.order'))._get_order(cr, uid, ids, context=context)
187 return res228 return res
188 229
189 def _get_difference(self, cursor, user, ids, name, arg, context=None):
190 res = {}
191 tot_diff = 0.0
192 for sale in self.browse(cursor, user, ids):
193 tot_diff = 0.0
194 for line in sale.order_line:
195 if line.lst_price:
196 tot_diff += (line.price_unit - line.lst_price) * line.product_uom_qty
197# tot_diff = tot_diff - line.packing_amount # Need to check if packing cost apply by qty sold?
198 res[sale.id] = tot_diff
199 return res
200
201 def _get_qty_total(self, cr, uid, ids):230 def _get_qty_total(self, cr, uid, ids):
202 res = {}231 res = {}
203 qty = 0.0232 qty = 0.0
@@ -210,7 +239,7 @@
210 _columns = {239 _columns = {
211 'contact_id': fields.many2one('res.partner', 'Contact'),240 'contact_id': fields.many2one('res.partner', 'Contact'),
212 'partner_shipping_id': fields.many2one('res.partner', 'Delivery Address', required=True, help="Delivery address for current sales order."),241 'partner_shipping_id': fields.many2one('res.partner', 'Delivery Address', required=True, help="Delivery address for current sales order."),
213 'packing_total': fields.function(_get_pack_total, type="float", string='Packing Cost', store=True),242 'packing_total': fields.function(_get_pack_total, type="float", string='Packing Cost', store=True, multi='_get_pack_total'),
214 'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Total',243 'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Total',
215 store={244 store={
216 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),245 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
@@ -220,7 +249,7 @@
220 'quote_validity': fields.integer('Quote Validity', help="Validity of Quote in days."),249 'quote_validity': fields.integer('Quote Validity', help="Validity of Quote in days."),
221 'subject': fields.text('Subject'),250 'subject': fields.text('Subject'),
222 'invoice_id': fields.many2one('account.invoice', 'Invoice ID'),251 'invoice_id': fields.many2one('account.invoice', 'Invoice ID'),
223 'dealers_disc': fields.function(_get_difference, type="float", string='Dealers Discount', store=True),252 'dealers_disc': fields.function(_get_pack_total, type="float", string='Dealers Discount', store=True, multi='_get_pack_total'),
224 'delivery_term': fields.integer('Delivery Term', help='Delivery Term in Weeks')253 'delivery_term': fields.integer('Delivery Term', help='Delivery Term in Weeks')
225 }254 }
226 255
@@ -228,18 +257,17 @@
228 """ create invoices for the given sales orders (ids), and open the form257 """ create invoices for the given sales orders (ids), and open the form
229 view of one of the newly created invoices258 view of one of the newly created invoices
230 """259 """
231 mod_obj = self.pool.get('ir.model.data')
232 wf_service = netsvc.LocalService("workflow")260 wf_service = netsvc.LocalService("workflow")
233261
234 # create invoices through the sales orders' workflow262 # create invoices through the sales orders' workflow
235 inv_ids0 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)263 inv_ids0 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
236 for id in ids:264 for sale_order_id in ids:
237 wf_service.trg_validate(uid, 'sale.order', id, 'manual_invoice', cr)265 wf_service.trg_validate(uid, 'sale.order', sale_order_id, 'manual_invoice', cr)
238 inv_ids1 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)266 inv_ids1 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
239 # determine newly created invoices267 # determine newly created invoices
240 new_inv_ids = list(inv_ids1 - inv_ids0)268 new_inv_ids = list(inv_ids1 - inv_ids0)
241 self.write(cr, uid, ids[0], {'invoice_id': new_inv_ids[0]}, context=context)269 self.write(cr, uid, ids[0], {'invoice_id': new_inv_ids[0]}, context=context)
242 res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')270 res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'invoice_form')
243 res_id = res and res[1] or False,271 res_id = res and res[1] or False,
244272
245 return {273 return {
@@ -256,21 +284,26 @@
256 }284 }
257 285
258 def _prepare_invoice(self, cr, uid, order, lines, context=None):286 def _prepare_invoice(self, cr, uid, order, lines, context=None):
287 """Override method of sale order to update invoice with delivery order
288 information.
289 :param browse_record order: sale.order record to invoice
290 :param list(int) line: list of invoice line IDs that must be
291 attached to the invoice
292 :return: dict of value to update the invoice
293 """
259 stock_picking_obj = self.pool.get('stock.picking')294 stock_picking_obj = self.pool.get('stock.picking')
260 res = super(sale_order, self)._prepare_invoice(cr, uid, order, lines, context=context)295 res = super(sale_order, self)._prepare_invoice(cr, uid, order, lines, context=context)
261 delivery_id = stock_picking_obj.search(cr, uid, [('sale_id', '=', order.id)], context=context)296 delivery_id = stock_picking_obj.search(cr, uid, [('sale_id', '=', order.id)], context=context)
262 if delivery_id:297 if delivery_id:
263 delivery = stock_picking_obj.browse(cr, uid, delivery_id[0], context=context)298 delivery = stock_picking_obj.browse(cr, uid, delivery_id[0], context=context)
264 delivery_date = delivery.date_done
265 delivery_name = delivery.name
266 res.update(299 res.update(
267 {300 {
268 'delivery_order_id': delivery_id[0],301 'delivery_order_id': delivery_id[0],
269 'delivery_address_id': order.partner_shipping_id.id,302 'delivery_address_id': order.partner_shipping_id.id,
270 'date': order.date_order,303 'date': order.date_order,
271 'carrier_id': order.carrier_id and order.carrier_id.id,304 'carrier_id': order.carrier_id and order.carrier_id.id,
272 'delivery_name': delivery_name or None,305 'delivery_name': delivery.date_done or None,
273 'delivery_date': delivery_date or False,306 'delivery_date': delivery.name or False,
274 'sale_id': order.id307 'sale_id': order.id
275 }308 }
276 )309 )
@@ -281,14 +314,21 @@
281 _inherit = 'sale.order.line'314 _inherit = 'sale.order.line'
282 315
283 def _amount_line(self, cr, uid, ids, field_name, arg, context=None):316 def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
317 '''
318 The purpose of this function is calculate price total value.
319 :param ids: list of order line ids
320 :param field_name: name of price subtotal
321 :returns: subtotal value
322 '''
284 packing_cost_allowed = False323 packing_cost_allowed = False
285 res = super(sale_order_line, self)._amount_line(cr, uid, ids, field_name, arg, context=context)324 res = super(sale_order_line, self)._amount_line(cr, uid, ids, field_name, arg, context=context)
286 for id in ids:325 for line_id in ids:
287 packing_cost_allowed = self.browse(cr, uid, id, context=context).order_id.company_id.packing_cost326 packing_cost_allowed = self.browse(cr, uid, line_id, context=context).order_id.company_id.packing_cost
288 if packing_cost_allowed:327 if packing_cost_allowed:
289 for sale_order_line_id in res:328 for sale_order_line_id in res:
290 qty = self.browse(cr, uid, sale_order_line_id, context=context).product_uom_qty329 sale_order_line_obj = self.browse(cr, uid, sale_order_line_id, context=context)
291 packing_amount = self.browse(cr, uid, sale_order_line_id, context=context).packing_amount330 qty = sale_order_line_obj.product_uom_qty
331 packing_amount = sale_order_line_obj.packing_amount
292 res[sale_order_line_id] += qty * packing_amount332 res[sale_order_line_id] += qty * packing_amount
293 return res333 return res
294 334
@@ -301,20 +341,25 @@
301 def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,341 def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
302 uom=False, qty_uos=0, uos=False, name='', partner_id=False,342 uom=False, qty_uos=0, uos=False, name='', partner_id=False,
303 lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):343 lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):
344 '''
345 The purpose of this function to get value of price unit, list price, packing amount on product change.
346 :return: return this value list price , price unit, packing amount.
347 :rtype: dictionary
348 '''
304 res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=0,349 res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=0,
305 uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id,350 uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id,
306 lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context)351 lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context)
307 context = context or {}352 context = context or {}
308 lang = lang or context.get('lang', False)353 lang = lang or context.get('lang', False)
309 partner_obj = self.pool.get('res.partner')
310 product_obj = self.pool.get('product.product')354 product_obj = self.pool.get('product.product')
311 if product:355 if product:
312 packing_cost_allowed = product_obj.browse(cr, uid, product, context=context).company_id.packing_cost356 product_product_obj = product_obj.browse(cr, uid, product, context=context)
313 dealers_discount_allowed = product_obj.browse(cr, uid, product, context=context).company_id.dealers_discount357 packing_cost_allowed = product_product_obj.company_id.packing_cost
358 dealers_discount_allowed = product_product_obj.company_id.dealers_discount
314 # Dealer's Discount Feature359 # Dealer's Discount Feature
315 if dealers_discount_allowed:360 if dealers_discount_allowed:
316 if partner_id:361 if partner_id:
317 partner_rec = partner_obj.browse(cr, uid, partner_id, context=context)362 partner_rec = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
318 if partner_rec.dealer_id:363 if partner_rec.dealer_id:
319 res['value']['lst_price'] = res['value']['price_unit']364 res['value']['lst_price'] = res['value']['price_unit']
320 res['value']['price_unit'] = 0.0365 res['value']['price_unit'] = 0.0
@@ -396,10 +441,11 @@
396 pay_term = order.partner_id.property_payment_term.id441 pay_term = order.partner_id.property_payment_term.id
397 else:442 else:
398 pay_term = False443 pay_term = False
399 delivery_id = stock_picking_obj.search(cr, uid, [('sale_id', '=', order.id)])444 delivery_ids = stock_picking_obj.search(cr, uid, [('sale_id', '=', order.id)])
400 for id in delivery_id:445 for delivery_id in delivery_ids:
401 delivery_date = stock_picking_obj.browse(cr, uid, id, context=context).date_done446 delivery = stock_picking_obj.browse(cr, uid, delivery_id, context=context)
402 delivery_name = stock_picking_obj.browse(cr, uid, id, context=context).name447 delivery_date = delivery.date_done
448 delivery_name = delivery.name
403 inv = {449 inv = {
404 'name': order.name,450 'name': order.name,
405 'origin': order.name,451 'origin': order.name,
@@ -464,6 +510,14 @@
464 _inherit = "stock.picking"510 _inherit = "stock.picking"
465 511
466 def _prepare_invoice(self, cr, uid, picking, partner, inv_type, journal_id, context=None):512 def _prepare_invoice(self, cr, uid, picking, partner, inv_type, journal_id, context=None):
513 """Override method of picking to update invoice with delivery order
514 information.
515 :param browse_record picking: stock.picking record to invoice
516 :param partner: browse record of partner
517 :param inv_type: invoice type (in or out invoice).
518 :param journal_id: journal id
519 :return: dict of value to update the invoice for picking
520 """
467 res = super(stock_picking, self)._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context)521 res = super(stock_picking, self)._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context)
468 freight_allowed = self.browse(cr, uid, picking.id, context=context).company_id.freight522 freight_allowed = self.browse(cr, uid, picking.id, context=context).company_id.freight
469 if picking.sale_id:523 if picking.sale_id:
@@ -488,17 +542,18 @@
488 542
489 def action_invoice_create(self, cr, uid, ids, journal_id=False,543 def action_invoice_create(self, cr, uid, ids, journal_id=False,
490 group=False, type='out_invoice', context=None):544 group=False, type='out_invoice', context=None):
491 sale_order_obj = self.pool.get('sale.order')545 """
492 546 Overrride method from picking to update invoice id to sale order.
493 for id in ids:547 """
494 sale_id = self.browse(cr, uid, id, context=context).sale_id.id548 for picking_id in ids:
549 sale_id = self.browse(cr, uid, picking_id, context=context).sale_id.id
495 550
496 res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=journal_id,551 res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=journal_id,
497 group=group, type=type, context=context)552 group=group, type=type, context=context)
498 553
499 for key in res:554 for key in res:
500 invoice_id = res[key]555 invoice_id = res[key]
501 sale_order_obj.write(cr, uid, sale_id, {'invoice_id': invoice_id}, context=context)556 self.pool.get('sale.order').write(cr, uid, sale_id, {'invoice_id': invoice_id}, context=context)
502 return res557 return res
503 558
504 559
@@ -515,8 +570,9 @@
515 res = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id,570 res = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id,
516 invoice_vals, context=context)571 invoice_vals, context=context)
517 572
518 dealers_discount_allowed = self.browse(cr, uid, picking.id, context=context).company_id.dealers_discount573 stock_picking_obj = self.browse(cr, uid, picking.id, context=context)
519 packing_cost_allowed = self.browse(cr, uid, picking.id, context=context).company_id.packing_cost574 dealers_discount_allowed = stock_picking_obj.company_id.dealers_discount
575 packing_cost_allowed = stock_picking_obj.company_id.packing_cost
520 576
521 # Dealer's Discount Feature577 # Dealer's Discount Feature
522 if dealers_discount_allowed:578 if dealers_discount_allowed:
@@ -532,11 +588,16 @@
532 _inherit = 'account.invoice'588 _inherit = 'account.invoice'
533 589
534 def _amount_all(self, cr, uid, ids, name, args, context=None):590 def _amount_all(self, cr, uid, ids, name, args, context=None):
591 """
592 Override function from account invoice.
593 Purpose of this function is to add freight charge to amount total.
594 """
535 res = super(account_invoice, self)._amount_all(cr, uid, ids, name, args, context=context)595 res = super(account_invoice, self)._amount_all(cr, uid, ids, name, args, context=context)
536 for invoice_id in res:596 for invoice_id in res:
537 freight_allowed = self.browse(cr, uid, invoice_id, context=context).company_id.freight597 account_invoice_obj = self.browse(cr, uid, invoice_id, context=context)
598 freight_allowed = account_invoice_obj.company_id.freight
538 if freight_allowed:599 if freight_allowed:
539 freight_charge = self.browse(cr, uid, invoice_id, context=context).freight_charge600 freight_charge = account_invoice_obj.freight_charge
540 res[invoice_id]['amount_total'] += freight_charge601 res[invoice_id]['amount_total'] += freight_charge
541 return res602 return res
542 603
@@ -549,24 +610,29 @@
549 return res610 return res
550 611
551 def _get_pack_total(self, cursor, user, ids, name, arg, context=None):612 def _get_pack_total(self, cursor, user, ids, name, arg, context=None):
613 '''
614 The purpose of this function is calculate packing total and dealers discount
615 @param user: pass login user id
616 @param ids: pass invoice id
617 @param name: pass packing_total
618 @param args: None
619 @param context: pass context in 'type' : 'out_invoice', 'no_store_function': True/False, 'journal_type': 'sale'
620 @return: return a dict in invoice_id with packing amount of invoice line.
621 @rtype : dict
622 '''
552 res = {}623 res = {}
553 tot_diff = 0.0
554 for invoice in self.browse(cursor, user, ids, context=context):624 for invoice in self.browse(cursor, user, ids, context=context):
555 tot_diff = 0.0625 res[invoice.id] = {
556 for line in invoice.invoice_line:626 'packing_total': 0.0,
557 tot_diff += line.packing_amount # Need to check if packing cost apply by qty sold? 627 'dealers_disc': 0.0,
558 res[invoice.id] = tot_diff628 }
559 return res629 packing_total = dealers_disc = 0.0
560
561 def _get_difference(self, cursor, user, ids, name, arg, context=None):
562 res = {}
563 tot_diff = 0.0
564 for invoice in self.browse(cursor, user, ids):
565 tot_diff = 0.0
566 for line in invoice.invoice_line:630 for line in invoice.invoice_line:
567 if line.lst_price:631 if line.lst_price:
568 tot_diff += (line.price_unit - line.lst_price) * line.quantity632 dealers_disc += (line.price_unit - line.lst_price) * line.quantity
569 res[invoice.id] = tot_diff633 packing_total += line.packing_amount # Need to check if packing cost apply by qty sold?
634 res[invoice.id]['packing_total'] = packing_total
635 res[invoice.id]['dealers_disc'] = dealers_disc
570 return res636 return res
571 637
572 def _get_qty_total(self, cr, uid, ids):638 def _get_qty_total(self, cr, uid, ids):
@@ -579,6 +645,13 @@
579 return res645 return res
580 646
581 def amount_to_text(self, amount, currency):647 def amount_to_text(self, amount, currency):
648 '''
649 The purpose of this function is to use payment amount change in word
650 @param amount: pass Total payment of amount
651 @param currency: pass which currency to pay
652 @return: return amount in word
653 @rtype : string
654 '''
582 amount_in_word = amount_to_text(amount)655 amount_in_word = amount_to_text(amount)
583 if currency == 'INR':656 if currency == 'INR':
584 amount_in_word = amount_in_word.replace("euro", "Rupees").replace("Cents", "Paise").replace("Cent", "Paise")657 amount_in_word = amount_in_word.replace("euro", "Rupees").replace("Cents", "Paise").replace("Cent", "Paise")
@@ -599,11 +672,6 @@
599 })672 })
600 return super(account_invoice, self).copy(cr, uid, id, default, context)673 return super(account_invoice, self).copy(cr, uid, id, default, context)
601 674
602 def _check_freight_allowed(self, cr, uid, ids, context=None):
603 res_company_obj = self.pool.get('res.company')
604 freight_allowed = res_company_obj.browse(cr, uid, uid, context=context).freight
605 return freight_allowed
606
607 _columns = {675 _columns = {
608 'delivery_order_id': fields.many2one('stock.picking', 'Delivery Order', readonly="True"),676 'delivery_order_id': fields.many2one('stock.picking', 'Delivery Order', readonly="True"),
609 'delivery_address_id': fields.many2one('res.partner', 'Delivery Address'),677 'delivery_address_id': fields.many2one('res.partner', 'Delivery Address'),
@@ -615,8 +683,8 @@
615 'dispatch_doc_no': fields.char('Dispatch Document No.', size=16),683 'dispatch_doc_no': fields.char('Dispatch Document No.', size=16),
616 'dispatch_doc_date': fields.date('Dispatch Document Date'),684 'dispatch_doc_date': fields.date('Dispatch Document Date'),
617 'consignee_account': fields.char('Consignee Account', size=32, help="Account Name, applies when there is customer for consignee."),685 'consignee_account': fields.char('Consignee Account', size=32, help="Account Name, applies when there is customer for consignee."),
618 'dealers_disc': fields.function(_get_difference, type="float", string='Dealers Discount', store=True),686 'dealers_disc': fields.function(_get_pack_total, type="float", string='Dealers Discount', store=True, multi='_get_pack_total'),
619 'packing_total': fields.function(_get_pack_total, type="float", string='Packing Cost', store=True),687 'packing_total': fields.function(_get_pack_total, type="float", string='Packing Cost', store=True, multi='_get_pack_total'),
620 'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Subtotal', track_visibility='always',688 'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Subtotal', track_visibility='always',
621 store={689 store={
622 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),690 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
@@ -645,46 +713,31 @@
645 }713 }
646 714
647 _defaults = {715 _defaults = {
648 'freight_allowed': _check_freight_allowed,716 'freight_allowed': lambda self, cr, uid, context: self.pool.get('res.company').browse(cr, uid, uid, context=context).freight,
649 }717 }
650 718
651# def button_reset_taxes(self, cr, uid, ids, context=None):
652# if context is None:
653# context = {}
654# ctx = context.copy()
655# ait_obj = self.pool.get('account.invoice.tax')
656# for id in ids:
657# cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s AND manual is False", (id,))
658# partner = self.browse(cr, uid, id, context=ctx).partner_id
659# if partner.lang:
660# ctx.update({'lang': partner.lang})
661# for taxe in ait_obj.compute(cr, uid, id, context=ctx).values():
662# ait_obj.create(cr, uid, taxe)
663# # Update the stored value (fields.function), so we write to trigger recompute
664# self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=ctx)
665# return True
666#
667# def button_compute(self, cr, uid, ids, context=None, set_total=False):
668# self.button_reset_taxes(cr, uid, ids, context)
669# for inv in self.browse(cr, uid, ids, context=context):
670# if set_total:
671# self.pool.get('account.invoice').write(cr, uid, [inv.id], {'check_total': inv.amount_total})
672# return True
673
674class account_invoice_line(osv.osv):719class account_invoice_line(osv.osv):
675 720
676 _inherit = 'account.invoice.line'721 _inherit = 'account.invoice.line'
677722
678 def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict):723 def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict):
724 '''
725 The purpose of this function to give price subtotal.
726 :param: ids: list of invoice line record ids.
727 :param: prop: field price subtotal
728 :return: calculted price subtotal value.
729 :rtype: dictionary
730 '''
679 res = super(account_invoice_line, self)._amount_line(cr, uid, ids, prop, unknow_none, unknow_dict)731 res = super(account_invoice_line, self)._amount_line(cr, uid, ids, prop, unknow_none, unknow_dict)
680 packing_cost_allowed = False732 packing_cost_allowed = False
681 for id in ids:733 for invoice_line_id in ids:
682 if self.browse(cr, uid, id).invoice_id:734 if self.browse(cr, uid, invoice_line_id).invoice_id:
683 packing_cost_allowed = self.browse(cr, uid, id).invoice_id.company_id.packing_cost735 packing_cost_allowed = self.browse(cr, uid, invoice_line_id).invoice_id.company_id.packing_cost
684 if packing_cost_allowed:736 if packing_cost_allowed:
685 for account_invoice_line_id in res:737 for account_invoice_line_id in res:
686 qty = self.browse(cr, uid, account_invoice_line_id).quantity738 account_invoice_line_obj = self.browse(cr, uid, account_invoice_line_id)
687 packing_amount = self.browse(cr, uid, account_invoice_line_id).packing_amount739 qty = account_invoice_line_obj.quantity
740 packing_amount = account_invoice_line_obj.packing_amount
688 res[account_invoice_line_id] += qty * packing_amount741 res[account_invoice_line_id] += qty * packing_amount
689 return res742 return res
690 743
@@ -695,8 +748,12 @@
695 }748 }
696 749
697 def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):750 def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
751 '''
752 The purpose of this function to get value of price unit, list price and packing amount on product value change.
753 :return: return this value price unit, list price, packing amount
754 :rtype: dictionary
755 '''
698 res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty=qty, name=name, type=type, partner_id=partner_id, fposition_id=fposition_id, price_unit=price_unit, currency_id=currency_id, context=context, company_id=company_id)756 res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty=qty, name=name, type=type, partner_id=partner_id, fposition_id=fposition_id, price_unit=price_unit, currency_id=currency_id, context=context, company_id=company_id)
699 partner_obj = self.pool.get('res.partner')
700 product_obj = self.pool.get('product.product')757 product_obj = self.pool.get('product.product')
701758
702 if product:759 if product:
@@ -705,7 +762,7 @@
705 762
706 # Dealer's Discount Feature763 # Dealer's Discount Feature
707 if dealers_discount_allowed:764 if dealers_discount_allowed:
708 partner_rec = partner_obj.browse(cr, uid, partner_id, context=context)765 partner_rec = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
709 if not partner_rec.dealer_id:766 if not partner_rec.dealer_id:
710 res['value']['price_unit'] = res['value']['price_unit']767 res['value']['price_unit'] = res['value']['price_unit']
711 else:768 else:
@@ -726,6 +783,13 @@
726 _inherit = "account.invoice.tax"783 _inherit = "account.invoice.tax"
727784
728 def compute(self, cr, uid, invoice_id, context=None):785 def compute(self, cr, uid, invoice_id, context=None):
786 '''
787 The purpose of this function calculate the total tax amount include price of product and check invoice out/in
788 base_amount + tax_amount
789 @param ids: pass invoice id include tax for the product
790 @return: return tax category,total tax,product price * unit,invoice tax code,account ids etc..
791 @rtype : dict
792 '''
729 tax_grouped = {}793 tax_grouped = {}
730 tax_obj = self.pool.get('account.tax')794 tax_obj = self.pool.get('account.tax')
731 cur_obj = self.pool.get('res.currency')795 cur_obj = self.pool.get('res.currency')
@@ -784,29 +848,27 @@
784class purchase_order(osv.osv):848class purchase_order(osv.osv):
785 _inherit = 'purchase.order'849 _inherit = 'purchase.order'
786 850
787# def amount_to_text(self, amount):
788# amount_in_word = amount_to_text(amount)
789# amount_in_word = amount_in_word.replace("euro", "Rupees").replace("Cents", "Paise").replace("Cent", "Paise")
790# return amount_in_word
791
792 def _amount_all(self, cr, uid, ids, field_name, arg, context=None):851 def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
852 """
853 override function from purchase order to add inward freigh value with amount total.
854 return: amount total with inward freight value
855 """
793 res = super(purchase_order, self)._amount_all(cr, uid, ids, field_name, arg, context=context)856 res = super(purchase_order, self)._amount_all(cr, uid, ids, field_name, arg, context=context)
794 for purchase_id in res:857 for purchase_id in res:
795 freight_allowed = self.browse(cr, uid, purchase_id, context=context).company_id.freight858 purchase_order_obj = self.browse(cr, uid, purchase_id, context=context)
859 freight_allowed = purchase_order_obj.company_id.freight
796 if freight_allowed:860 if freight_allowed:
797 inward_freight = self.browse(cr, uid, purchase_id, context=context).inward_freight861 inward_freight = purchase_order_obj.inward_freight
798 res[purchase_id]['amount_total'] += inward_freight862 res[purchase_id]['amount_total'] += inward_freight
799 return res863 return res
800 864
801 def _get_order(self, cr, uid, ids, context=None):865 def _get_order(self, cr, uid, ids, context=None):
866 """
867 The purpose of this function is to recalculate amount total based on order line
868 """
802 res = super(purchase_order, self.pool.get('purchase.order'))._get_order(cr, uid, ids, context=context)869 res = super(purchase_order, self.pool.get('purchase.order'))._get_order(cr, uid, ids, context=context)
803 return res870 return res
804 871
805 def _check_freight_allowed(self, cr, uid, ids, context=None):
806 res_company = self.pool.get('res.company')
807 freight_allowed = res_company.browse(cr, uid, uid, context=context).freight
808 return freight_allowed
809
810 _columns = {872 _columns = {
811 'inward_freight': fields.float('Inward Freight'),873 'inward_freight': fields.float('Inward Freight'),
812 'freight_allowed': fields.boolean('Freight Allowed'),874 'freight_allowed': fields.boolean('Freight Allowed'),
@@ -826,7 +888,7 @@
826 }888 }
827 889
828 _defaults = {890 _defaults = {
829 'freight_allowed': _check_freight_allowed,891 'freight_allowed': lambda self, cr, uid, context: self.pool.get('res.company').browse(cr, uid, uid, context=context).freight,
830 }892 }
831 893
832 894
@@ -839,9 +901,10 @@
839 res = super(purchase_order, self).action_invoice_create(cr, uid, ids, context=context)901 res = super(purchase_order, self).action_invoice_create(cr, uid, ids, context=context)
840 account_invoice_obj = self.pool.get('account.invoice')902 account_invoice_obj = self.pool.get('account.invoice')
841 freight_allowed = False903 freight_allowed = False
842 for id in ids:904 for purchase_order_id in ids:
843 freight_allowed = self.browse(cr, uid, id, context=context).company_id.freight905 purchase_order_obj = self.browse(cr, uid, purchase_order_id, context=context)
844 inward_freight = self.browse(cr, uid, id, context=context).inward_freight906 freight_allowed = purchase_order_obj.company_id.freight
907 inward_freight = purchase_order_obj.inward_freight
845 if freight_allowed:908 if freight_allowed:
846 account_invoice_obj.write(cr, uid, res, {'freight_charge': inward_freight}, context=context)909 account_invoice_obj.write(cr, uid, res, {'freight_charge': inward_freight}, context=context)
847 account_invoice_obj.button_compute(cr, uid, [res], context=context, set_total=True)910 account_invoice_obj.button_compute(cr, uid, [res], context=context, set_total=True)
848911
=== modified file 'l10n_in_tax_retail_invoice/report/purchase_order.py'
--- l10n_in_tax_retail_invoice/report/purchase_order.py 2013-05-23 08:40:28 +0000
+++ l10n_in_tax_retail_invoice/report/purchase_order.py 2013-06-20 10:57:25 +0000
@@ -21,7 +21,7 @@
2121
22import time22import time
2323
24from report import report_sxw24from openerp.report import report_sxw
2525
26class purchase_order(report_sxw.rml_parse):26class purchase_order(report_sxw.rml_parse):
27 27
2828
=== modified file 'l10n_in_tax_retail_invoice/report/quotation.py'
--- l10n_in_tax_retail_invoice/report/quotation.py 2013-05-23 08:40:28 +0000
+++ l10n_in_tax_retail_invoice/report/quotation.py 2013-06-20 10:57:25 +0000
@@ -21,7 +21,7 @@
2121
22import time22import time
2323
24from report import report_sxw24from openerp.report import report_sxw
2525
26class quotation(report_sxw.rml_parse):26class quotation(report_sxw.rml_parse):
27 27
2828
=== modified file 'l10n_in_tax_retail_invoice/report/sale_order_tax.py'
--- l10n_in_tax_retail_invoice/report/sale_order_tax.py 2013-05-23 08:40:28 +0000
+++ l10n_in_tax_retail_invoice/report/sale_order_tax.py 2013-06-20 10:57:25 +0000
@@ -20,7 +20,7 @@
20##############################################################################20##############################################################################
2121
22import time22import time
23from report import report_sxw23from openerp.report import report_sxw
24from openerp.tools.translate import _24from openerp.tools.translate import _
25from openerp.osv import fields, osv25from openerp.osv import fields, osv
2626
2727
=== modified file 'l10n_in_tax_retail_invoice/report/sale_order_tax.rml'
--- l10n_in_tax_retail_invoice/report/sale_order_tax.rml 2013-05-23 08:40:28 +0000
+++ l10n_in_tax_retail_invoice/report/sale_order_tax.rml 2013-06-20 10:57:25 +0000
@@ -247,12 +247,12 @@
247 <font face="Helvetica-Bold">Sales Order</font>247 <font face="Helvetica-Bold">Sales Order</font>
248 <font color="white">..................................................................</font>248 <font color="white">..................................................................</font>
249 </para>249 </para>
250 <blockTable colWidths="240.0,113.0,177.0" style="Table9">250 <blockTable colWidths="200.0,133.0,197.0" style="Table9">
251 <tr>251 <tr>
252 <td>252 <td>
253 <para style="P22">Buyer (if other than consignee)</para>253 <para style="P22">Buyer (if other than consignee)</para>
254 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>254 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
255 <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para>255 <para style="P21">[[ display_address(o.partner_id) ]]</para>
256 </td>256 </td>
257 <td>257 <td>
258 <para style="P10">Order No.</para>258 <para style="P10">Order No.</para>
@@ -265,7 +265,7 @@
265 </tr>265 </tr>
266 <tr>266 <tr>
267 <td>267 <td>
268 <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '' ]], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para>268 <para style="P21"></para>
269 </td>269 </td>
270 <td>270 <td>
271 <para style="P10">Mode/Terms of Payment</para>271 <para style="P10">Mode/Terms of Payment</para>
@@ -277,14 +277,14 @@
277 </td>277 </td>
278 </tr>278 </tr>
279 </blockTable>279 </blockTable>
280 <blockTable colWidths="240.0,113.0,177.0" style="Table10">280 <blockTable colWidths="200.0,133.0,197.0" style="Table10">
281 <tr>281 <tr>
282 <td>282 <td>
283 <para style="P17">283 <para style="P17">
284 <font face="Helvetica" size="8.0">Consignee</font>284 <font face="Helvetica" size="8.0">Consignee</font>
285 </para>285 </para>
286 <para style="P23">[[ (o.partner_shipping_id and o.partner_shipping_id.title and o.partner_shipping_id.title.name) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.name) or '' ]]</para>286 <para style="P23">[[ (o.partner_shipping_id and o.partner_shipping_id.title and o.partner_shipping_id.title.name) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.name) or '' ]]</para>
287 <para style="P21">[[ (o.partner_shipping_id and o.partner_shipping_id.street) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.street2)]]</para>287 <para style="P21">[[ display_address(o.partner_shipping_id) ]]</para>
288 </td>288 </td>
289 <td>289 <td>
290 <para style="P10">Buyer's Order No.</para>290 <para style="P10">Buyer's Order No.</para>
@@ -297,7 +297,7 @@
297 </tr>297 </tr>
298 <tr>298 <tr>
299 <td>299 <td>
300 <para style="P21">[[ (o.partner_shipping_id and o.partner_shipping_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '' ]], [[ (o.partner_shipping_id and o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name)]].</para>300 <para style="P21"></para>
301 </td>301 </td>
302 <td>302 <td>
303 <para style="P10">Dispatched through</para>303 <para style="P10">Dispatched through</para>
@@ -309,7 +309,7 @@
309 </td>309 </td>
310 </tr>310 </tr>
311 </blockTable>311 </blockTable>
312 <blockTable colWidths="240.0,290.0" style="Table11">312 <blockTable colWidths="200.0,330.0" style="Table11">
313 <tr>313 <tr>
314 <td>314 <td>
315 </td>315 </td>
@@ -677,7 +677,7 @@
677 <para style="terp_default_9">677 <para style="terp_default_9">
678 <font color="white"> </font>678 <font color="white"> </font>
679 </para>679 </para>
680 <blockTable colWidths="334.0,197.0" style="Table8">680 <blockTable colWidths="334.0,205.0" style="Table8">
681 <tr>681 <tr>
682 <td>682 <td>
683 <para style="terp_default_9">Declaration</para>683 <para style="terp_default_9">Declaration</para>
684684
=== modified file 'l10n_in_tax_retail_invoice/report/tax_invoice.py'
--- l10n_in_tax_retail_invoice/report/tax_invoice.py 2013-05-23 08:40:28 +0000
+++ l10n_in_tax_retail_invoice/report/tax_invoice.py 2013-06-20 10:57:25 +0000
@@ -21,7 +21,7 @@
2121
22import time22import time
2323
24from report import report_sxw24from openerp.report import report_sxw
2525
26class tax_invoice(report_sxw.rml_parse):26class tax_invoice(report_sxw.rml_parse):
27 27
2828
=== modified file 'l10n_in_tax_retail_invoice/report/tax_invoice.rml'
--- l10n_in_tax_retail_invoice/report/tax_invoice.rml 2013-05-23 08:40:28 +0000
+++ l10n_in_tax_retail_invoice/report/tax_invoice.rml 2013-06-20 10:57:25 +0000
@@ -241,12 +241,12 @@
241 <font color="white">.............................................................</font>241 <font color="white">.............................................................</font>
242 <font face="Helvetica" size="7.0">(Original)</font>242 <font face="Helvetica" size="7.0">(Original)</font>
243 </para>243 </para>
244 <blockTable colWidths="230.0,140.0,160.0" style="Table9">244 <blockTable colWidths="210.0,160.0,160.0" style="Table9">
245 <tr>245 <tr>
246 <td>246 <td>
247 <para style="P22">Buyer (if other than consignee)</para>247 <para style="P22">Buyer (if other than consignee)</para>
248 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>248 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
249 <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para>249 <para style="P21">[[ display_address(o.partner_id) ]]</para>
250 </td>250 </td>
251 <td>251 <td>
252 <para style="P10">Invoice No.</para>252 <para style="P10">Invoice No.</para>
@@ -259,8 +259,6 @@
259 </tr>259 </tr>
260 <tr>260 <tr>
261 <td>261 <td>
262 <para style="P21">[[ (o.partner_id and o.partner_id.village_taluka) or '' ]]</para>
263 <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '']], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para>
264 </td>262 </td>
265 <td>263 <td>
266 <para style="P10">Delivery Note</para>264 <para style="P10">Delivery Note</para>
@@ -287,14 +285,14 @@
287 </td>285 </td>
288 </tr>286 </tr>
289 </blockTable>287 </blockTable>
290 <blockTable colWidths="230.0,140.0,160.0" style="Table10">288 <blockTable colWidths="210.0,160.0,160.0" style="Table10">
291 <tr>289 <tr>
292 <td>290 <td>
293 <para style="P17">291 <para style="P17">
294 <font face="Helvetica" size="8.0">Consignee</font>292 <font face="Helvetica" size="8.0">Consignee</font>
295 </para>293 </para>
296 <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para>294 <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para>
297 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.street) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.street2)]]</para>295 <para style="P21">[[ display_address(o.delivery_address_id) ]]</para>
298 </td>296 </td>
299 <td>297 <td>
300 <para style="P10">Buyer's Order No.</para>298 <para style="P10">Buyer's Order No.</para>
@@ -307,8 +305,6 @@
307 </tr>305 </tr>
308 <tr>306 <tr>
309 <td>307 <td>
310 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.village_taluka) or '' ]]</para>
311 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.city) or '' ]] - [[ (o.delivery_address_id and o.delivery_address_id.zip) or '']], [[ (o.delivery_address_id and o.delivery_address_id.state_id and o.delivery_address_id.state_id.name)]].</para>
312 </td>308 </td>
313 <td>309 <td>
314 <para style="P10">Dispatch Document No.</para>310 <para style="P10">Dispatch Document No.</para>
@@ -333,7 +329,7 @@
333 </td>329 </td>
334 </tr>330 </tr>
335 </blockTable>331 </blockTable>
336 <blockTable colWidths="230.0,300.0" style="Table11">332 <blockTable colWidths="210.0,320.0" style="Table11">
337 <tr>333 <tr>
338 <td>334 <td>
339 <para style="P1">335 <para style="P1">
@@ -347,7 +343,7 @@
347 </tr>343 </tr>
348 </blockTable> 344 </blockTable>
349 345
350 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]]346 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
351 <tr>347 <tr>
352 <td>348 <td>
353 <para style="P1">Description of Goods</para>349 <para style="P1">Description of Goods</para>
@@ -398,7 +394,7 @@
398 394
399 <section>395 <section>
400 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>396 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
401 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]397 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
402 <tr>398 <tr>
403 <td>399 <td>
404 <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para>400 <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para>
@@ -515,7 +511,7 @@
515 511
516 <section>512 <section>
517 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>513 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
518 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]]514 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]]
519 <tr>515 <tr>
520 <td>516 <td>
521 <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para>517 <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para>
@@ -579,7 +575,76 @@
579 </blockTable>575 </blockTable>
580 </section>576 </section>
581 577
582 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]]578 <section>
579 <blockTable colWidths="210.0,70.0,50.0,71.0,40.0,89.0" style="Table5"> [[( o.freight_allowed == True and o.company_id.packing_cost == False) or removeParentNode('blockTable')]]
580 <tr>
581 <td>
582 <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para>
583 </td>
584 <td>
585 <para style="P1">
586 <font color="white"> </font>
587 </para>
588 </td>
589 <td>
590 <para style="P1">
591 <font color="white"> </font>
592 </para>
593 </td>
594 <td>
595 <para style="P1">
596 <font color="white"> </font>
597 </para>
598 </td>
599 <td>
600 <para style="P1">
601 <font color="white"> </font>
602 </para>
603 </td>
604 <td>
605 <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para>
606 </td>
607 </tr>
608 </blockTable>
609
610 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[( o.company_id.packing_cost and o.freight_allowed == True) or removeParentNode('blockTable')]]
611 <tr>
612 <td>
613 <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para>
614 </td>
615 <td>
616 <para style="P1">
617 <font color="white"> </font>
618 </para>
619 </td>
620 <td>
621 <para style="P1">
622 <font color="white"> </font>
623 </para>
624 </td>
625 <td>
626 <para style="P1">
627 <font color="white"> </font>
628 </para>
629 </td>
630 <td>
631 <para style="P1">
632 <font color="white"> </font>
633 </para>
634 </td>
635 <td>
636 <para style="P1">
637 <font color="white"> </font>
638 </para>
639 </td>
640 <td>
641 <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para>
642 </td>
643 </tr>
644 </blockTable>
645 </section>
646
647 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]]
583 <tr>648 <tr>
584 <td>649 <td>
585 <para style="terp_default_10">Dealers' Discount </para>650 <para style="terp_default_10">Dealers' Discount </para>
@@ -640,7 +705,7 @@
640 </tr>705 </tr>
641 </blockTable>706 </blockTable>
642 707
643 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]708 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
644 <tr>709 <tr>
645 <td>710 <td>
646 <para style="terp_default_10">Total</para>711 <para style="terp_default_10">Total</para>
@@ -703,7 +768,7 @@
703 <para style="terp_default_9">768 <para style="terp_default_9">
704 <font color="white"> </font>769 <font color="white"> </font>
705 </para>770 </para>
706 <blockTable colWidths="334.0,197.0" style="Table8">771 <blockTable colWidths="334.0,205.0" style="Table8">
707 <tr>772 <tr>
708 <td>773 <td>
709 <para style="terp_default_9">Declaration</para>774 <para style="terp_default_9">Declaration</para>
@@ -750,12 +815,12 @@
750 <font color="white">..........................................................</font>815 <font color="white">..........................................................</font>
751 <font face="Helvetica" size="7.0">(Duplicate)</font>816 <font face="Helvetica" size="7.0">(Duplicate)</font>
752 </para>817 </para>
753 <blockTable colWidths="230.0,140.0,160.0" style="Table9">818 <blockTable colWidths="210.0,160.0,160.0" style="Table9">
754 <tr>819 <tr>
755 <td>820 <td>
756 <para style="P22">Buyer (if other than consignee)</para>821 <para style="P22">Buyer (if other than consignee)</para>
757 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>822 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
758 <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para>823 <para style="P21">[[ display_address(o.partner_id) ]]</para>
759 </td>824 </td>
760 <td>825 <td>
761 <para style="P10">Invoice No.</para>826 <para style="P10">Invoice No.</para>
@@ -768,8 +833,6 @@
768 </tr>833 </tr>
769 <tr>834 <tr>
770 <td>835 <td>
771 <para style="P21">[[ (o.partner_id and o.partner_id.village_taluka) or '' ]]</para>
772 <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '']], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para>
773 </td>836 </td>
774 <td>837 <td>
775 <para style="P10">Delivery Note</para>838 <para style="P10">Delivery Note</para>
@@ -796,14 +859,14 @@
796 </td>859 </td>
797 </tr>860 </tr>
798 </blockTable>861 </blockTable>
799 <blockTable colWidths="230.0,140.0,160.0" style="Table10">862 <blockTable colWidths="210.0,160.0,160.0" style="Table10">
800 <tr>863 <tr>
801 <td>864 <td>
802 <para style="P17">865 <para style="P17">
803 <font face="Helvetica" size="8.0">Consignee</font>866 <font face="Helvetica" size="8.0">Consignee</font>
804 </para>867 </para>
805 <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para>868 <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para>
806 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.street) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.street2)]]</para>869 <para style="P21">[[ display_address(o.delivery_address_id) ]]</para>
807 </td>870 </td>
808 <td>871 <td>
809 <para style="P10">Buyer's Order No.</para>872 <para style="P10">Buyer's Order No.</para>
@@ -816,8 +879,6 @@
816 </tr>879 </tr>
817 <tr>880 <tr>
818 <td>881 <td>
819 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.village_taluka) or '' ]]</para>
820 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.city) or '' ]] - [[ (o.delivery_address_id and o.delivery_address_id.zip) or '']], [[ (o.delivery_address_id and o.delivery_address_id.state_id and o.delivery_address_id.state_id.name)]].</para>
821 </td>882 </td>
822 <td>883 <td>
823 <para style="P10">Dispatch Document No.</para>884 <para style="P10">Dispatch Document No.</para>
@@ -842,7 +903,7 @@
842 </td>903 </td>
843 </tr>904 </tr>
844 </blockTable>905 </blockTable>
845 <blockTable colWidths="230.0,300.0" style="Table11">906 <blockTable colWidths="210.0,320.0" style="Table11">
846 <tr>907 <tr>
847 <td>908 <td>
848 <para style="P1">909 <para style="P1">
@@ -856,7 +917,7 @@
856 </tr>917 </tr>
857 </blockTable>918 </blockTable>
858 919
859 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]]920 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
860 <tr>921 <tr>
861 <td>922 <td>
862 <para style="P1">Description of Goods</para>923 <para style="P1">Description of Goods</para>
@@ -907,7 +968,7 @@
907 968
908 <section>969 <section>
909 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>970 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
910 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]971 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
911 <tr>972 <tr>
912 <td>973 <td>
913 <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para>974 <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para>
@@ -1024,7 +1085,7 @@
1024 1085
1025 <section>1086 <section>
1026 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>1087 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
1027 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]]1088 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]]
1028 <tr>1089 <tr>
1029 <td>1090 <td>
1030 <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para>1091 <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para>
@@ -1087,7 +1148,76 @@
1087 </tr>1148 </tr>
1088 </blockTable>1149 </blockTable>
1089 </section>1150 </section>
1090 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]]1151
1152 <section>
1153 <blockTable colWidths="210.0,70.0,50.0,71.0,40.0,89.0" style="Table5"> [[( o.freight_allowed == True and o.company_id.packing_cost == False) or removeParentNode('blockTable')]]
1154 <tr>
1155 <td>
1156 <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para>
1157 </td>
1158 <td>
1159 <para style="P1">
1160 <font color="white"> </font>
1161 </para>
1162 </td>
1163 <td>
1164 <para style="P1">
1165 <font color="white"> </font>
1166 </para>
1167 </td>
1168 <td>
1169 <para style="P1">
1170 <font color="white"> </font>
1171 </para>
1172 </td>
1173 <td>
1174 <para style="P1">
1175 <font color="white"> </font>
1176 </para>
1177 </td>
1178 <td>
1179 <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para>
1180 </td>
1181 </tr>
1182 </blockTable>
1183
1184 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[( o.company_id.packing_cost and o.freight_allowed == True) or removeParentNode('blockTable')]]
1185 <tr>
1186 <td>
1187 <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para>
1188 </td>
1189 <td>
1190 <para style="P1">
1191 <font color="white"> </font>
1192 </para>
1193 </td>
1194 <td>
1195 <para style="P1">
1196 <font color="white"> </font>
1197 </para>
1198 </td>
1199 <td>
1200 <para style="P1">
1201 <font color="white"> </font>
1202 </para>
1203 </td>
1204 <td>
1205 <para style="P1">
1206 <font color="white"> </font>
1207 </para>
1208 </td>
1209 <td>
1210 <para style="P1">
1211 <font color="white"> </font>
1212 </para>
1213 </td>
1214 <td>
1215 <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para>
1216 </td>
1217 </tr>
1218 </blockTable>
1219 </section>
1220 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]]
1091 <tr>1221 <tr>
1092 <td>1222 <td>
1093 <para style="terp_default_10">Dealers' Discount </para>1223 <para style="terp_default_10">Dealers' Discount </para>
@@ -1149,7 +1279,7 @@
1149 </blockTable>1279 </blockTable>
1150 1280
1151 1281
1152 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]1282 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
1153 <tr>1283 <tr>
1154 <td>1284 <td>
1155 <para style="terp_default_10">Total</para>1285 <para style="terp_default_10">Total</para>
@@ -1212,7 +1342,7 @@
1212 <para style="terp_default_9">1342 <para style="terp_default_9">
1213 <font color="white"> </font>1343 <font color="white"> </font>
1214 </para>1344 </para>
1215 <blockTable colWidths="334.0,197.0" style="Table8">1345 <blockTable colWidths="334.0,205.0" style="Table8">
1216 <tr>1346 <tr>
1217 <td>1347 <td>
1218 <para style="terp_default_9">Declaration</para>1348 <para style="terp_default_9">Declaration</para>
@@ -1259,12 +1389,12 @@
1259 <font color="white">.........................................................</font>1389 <font color="white">.........................................................</font>
1260 <font face="Helvetica" size="7.0">(Triplicate)</font>1390 <font face="Helvetica" size="7.0">(Triplicate)</font>
1261 </para>1391 </para>
1262 <blockTable colWidths="230.0,140.0,160.0" style="Table9">1392 <blockTable colWidths="210.0,160.0,160.0" style="Table9">
1263 <tr>1393 <tr>
1264 <td>1394 <td>
1265 <para style="P22">Buyer (if other than consignee)</para>1395 <para style="P22">Buyer (if other than consignee)</para>
1266 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>1396 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
1267 <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para>1397 <para style="P21">[[ display_address(o.partner_id) ]]</para>
1268 </td>1398 </td>
1269 <td>1399 <td>
1270 <para style="P10">Invoice No.</para>1400 <para style="P10">Invoice No.</para>
@@ -1277,8 +1407,6 @@
1277 </tr>1407 </tr>
1278 <tr>1408 <tr>
1279 <td>1409 <td>
1280 <para style="P21">[[ (o.partner_id and o.partner_id.village_taluka) or '' ]]</para>
1281 <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '']], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para>
1282 </td>1410 </td>
1283 <td>1411 <td>
1284 <para style="P10">Delivery Note</para>1412 <para style="P10">Delivery Note</para>
@@ -1305,14 +1433,14 @@
1305 </td>1433 </td>
1306 </tr>1434 </tr>
1307 </blockTable>1435 </blockTable>
1308 <blockTable colWidths="230.0,140.0,160.0" style="Table10">1436 <blockTable colWidths="210.0,160.0,160.0" style="Table10">
1309 <tr>1437 <tr>
1310 <td>1438 <td>
1311 <para style="P17">1439 <para style="P17">
1312 <font face="Helvetica" size="8.0">Consignee</font>1440 <font face="Helvetica" size="8.0">Consignee</font>
1313 </para>1441 </para>
1314 <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para>1442 <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para>
1315 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.street) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.street2)]]</para>1443 <para style="P21">[[ display_address(o.delivery_address_id) ]]</para>
1316 </td>1444 </td>
1317 <td>1445 <td>
1318 <para style="P10">Buyer's Order No.</para>1446 <para style="P10">Buyer's Order No.</para>
@@ -1325,8 +1453,6 @@
1325 </tr>1453 </tr>
1326 <tr>1454 <tr>
1327 <td>1455 <td>
1328 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.village_taluka) or '' ]]</para>
1329 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.city) or '' ]] - [[ (o.delivery_address_id and o.delivery_address_id.zip) or '']], [[ (o.delivery_address_id and o.delivery_address_id.state_id and o.delivery_address_id.state_id.name)]].</para>
1330 </td>1456 </td>
1331 <td>1457 <td>
1332 <para style="P10">Dispatch Document No.</para>1458 <para style="P10">Dispatch Document No.</para>
@@ -1351,7 +1477,7 @@
1351 </td>1477 </td>
1352 </tr>1478 </tr>
1353 </blockTable>1479 </blockTable>
1354 <blockTable colWidths="230.0,300.0" style="Table11">1480 <blockTable colWidths="210.0,320.0" style="Table11">
1355 <tr>1481 <tr>
1356 <td>1482 <td>
1357 <para style="P1">1483 <para style="P1">
@@ -1365,7 +1491,7 @@
1365 </tr>1491 </tr>
1366 </blockTable>1492 </blockTable>
1367 1493
1368 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]]1494 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
1369 <tr>1495 <tr>
1370 <td>1496 <td>
1371 <para style="P1">Description of Goods</para>1497 <para style="P1">Description of Goods</para>
@@ -1416,7 +1542,7 @@
1416 1542
1417 <section>1543 <section>
1418 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>1544 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
1419 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]1545 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
1420 <tr>1546 <tr>
1421 <td>1547 <td>
1422 <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para>1548 <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para>
@@ -1533,7 +1659,7 @@
1533 1659
1534 <section>1660 <section>
1535 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>1661 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
1536 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]]1662 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]]
1537 <tr>1663 <tr>
1538 <td>1664 <td>
1539 <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para>1665 <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para>
@@ -1597,7 +1723,76 @@
1597 </blockTable>1723 </blockTable>
1598 </section>1724 </section>
1599 1725
1600 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]]1726 <section>
1727 <blockTable colWidths="210.0,70.0,50.0,71.0,40.0,89.0" style="Table5"> [[( o.freight_allowed == True and o.company_id.packing_cost == False) or removeParentNode('blockTable')]]
1728 <tr>
1729 <td>
1730 <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para>
1731 </td>
1732 <td>
1733 <para style="P1">
1734 <font color="white"> </font>
1735 </para>
1736 </td>
1737 <td>
1738 <para style="P1">
1739 <font color="white"> </font>
1740 </para>
1741 </td>
1742 <td>
1743 <para style="P1">
1744 <font color="white"> </font>
1745 </para>
1746 </td>
1747 <td>
1748 <para style="P1">
1749 <font color="white"> </font>
1750 </para>
1751 </td>
1752 <td>
1753 <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para>
1754 </td>
1755 </tr>
1756 </blockTable>
1757
1758 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[( o.company_id.packing_cost and o.freight_allowed == True) or removeParentNode('blockTable')]]
1759 <tr>
1760 <td>
1761 <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para>
1762 </td>
1763 <td>
1764 <para style="P1">
1765 <font color="white"> </font>
1766 </para>
1767 </td>
1768 <td>
1769 <para style="P1">
1770 <font color="white"> </font>
1771 </para>
1772 </td>
1773 <td>
1774 <para style="P1">
1775 <font color="white"> </font>
1776 </para>
1777 </td>
1778 <td>
1779 <para style="P1">
1780 <font color="white"> </font>
1781 </para>
1782 </td>
1783 <td>
1784 <para style="P1">
1785 <font color="white"> </font>
1786 </para>
1787 </td>
1788 <td>
1789 <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para>
1790 </td>
1791 </tr>
1792 </blockTable>
1793 </section>
1794
1795 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]]
1601 <tr>1796 <tr>
1602 <td>1797 <td>
1603 <para style="terp_default_10">Dealers' Discount </para>1798 <para style="terp_default_10">Dealers' Discount </para>
@@ -1658,7 +1853,7 @@
1658 </tr>1853 </tr>
1659 </blockTable>1854 </blockTable>
1660 1855
1661 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]1856 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
1662 <tr>1857 <tr>
1663 <td>1858 <td>
1664 <para style="terp_default_10">Total</para>1859 <para style="terp_default_10">Total</para>
@@ -1721,7 +1916,7 @@
1721 <para style="terp_default_9">1916 <para style="terp_default_9">
1722 <font color="white"> </font>1917 <font color="white"> </font>
1723 </para>1918 </para>
1724 <blockTable colWidths="334.0,197.0" style="Table8">1919 <blockTable colWidths="334.0,205.0" style="Table8">
1725 <tr>1920 <tr>
1726 <td>1921 <td>
1727 <para style="terp_default_9">Declaration</para>1922 <para style="terp_default_9">Declaration</para>
@@ -1768,12 +1963,12 @@
1768 <font color="white">........................................................</font>1963 <font color="white">........................................................</font>
1769 <font face="Helvetica" size="7.0">(Extra Copy)</font>1964 <font face="Helvetica" size="7.0">(Extra Copy)</font>
1770 </para>1965 </para>
1771 <blockTable colWidths="230.0,140.0,160.0" style="Table9">1966 <blockTable colWidths="210.0,160.0,160.0" style="Table9">
1772 <tr>1967 <tr>
1773 <td>1968 <td>
1774 <para style="P22">Buyer (if other than consignee)</para>1969 <para style="P22">Buyer (if other than consignee)</para>
1775 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>1970 <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
1776 <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para>1971 <para style="P21">[[ display_address(o.partner_id) ]]</para>
1777 </td>1972 </td>
1778 <td>1973 <td>
1779 <para style="P10">Invoice No.</para>1974 <para style="P10">Invoice No.</para>
@@ -1786,8 +1981,6 @@
1786 </tr>1981 </tr>
1787 <tr>1982 <tr>
1788 <td>1983 <td>
1789 <para style="P21">[[ (o.partner_id and o.partner_id.village_taluka) or '' ]]</para>
1790 <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '']], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para>
1791 </td>1984 </td>
1792 <td>1985 <td>
1793 <para style="P10">Delivery Note</para>1986 <para style="P10">Delivery Note</para>
@@ -1814,14 +2007,14 @@
1814 </td>2007 </td>
1815 </tr>2008 </tr>
1816 </blockTable>2009 </blockTable>
1817 <blockTable colWidths="230.0,140.0,160.0" style="Table10">2010 <blockTable colWidths="210.0,160.0,160.0" style="Table10">
1818 <tr>2011 <tr>
1819 <td>2012 <td>
1820 <para style="P17">2013 <para style="P17">
1821 <font face="Helvetica" size="8.0">Consignee</font>2014 <font face="Helvetica" size="8.0">Consignee</font>
1822 </para>2015 </para>
1823 <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para>2016 <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para>
1824 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.street) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.street2)]]</para>2017 <para style="P21">[[ display_address(o.delivery_address_id) ]]</para>
1825 </td>2018 </td>
1826 <td>2019 <td>
1827 <para style="P10">Buyer's Order No.</para>2020 <para style="P10">Buyer's Order No.</para>
@@ -1834,8 +2027,6 @@
1834 </tr>2027 </tr>
1835 <tr>2028 <tr>
1836 <td>2029 <td>
1837 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.village_taluka) or '' ]]</para>
1838 <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.city) or '' ]] - [[ (o.delivery_address_id and o.delivery_address_id.zip) or '']], [[ (o.delivery_address_id and o.delivery_address_id.state_id and o.delivery_address_id.state_id.name)]].</para>
1839 </td>2030 </td>
1840 <td>2031 <td>
1841 <para style="P10">Dispatch Document No.</para>2032 <para style="P10">Dispatch Document No.</para>
@@ -1860,7 +2051,7 @@
1860 </td>2051 </td>
1861 </tr>2052 </tr>
1862 </blockTable>2053 </blockTable>
1863 <blockTable colWidths="230.0,300.0" style="Table11">2054 <blockTable colWidths="210.0,320.0" style="Table11">
1864 <tr>2055 <tr>
1865 <td>2056 <td>
1866 <para style="P1">2057 <para style="P1">
@@ -1874,7 +2065,7 @@
1874 </tr>2065 </tr>
1875 </blockTable>2066 </blockTable>
1876 2067
1877 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]]2068 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
1878 <tr>2069 <tr>
1879 <td>2070 <td>
1880 <para style="P1">Description of Goods</para>2071 <para style="P1">Description of Goods</para>
@@ -1925,7 +2116,7 @@
1925 2116
1926 <section>2117 <section>
1927 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>2118 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
1928 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]2119 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
1929 <tr>2120 <tr>
1930 <td>2121 <td>
1931 <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para>2122 <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para>
@@ -2042,7 +2233,7 @@
2042 2233
2043 <section>2234 <section>
2044 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>2235 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
2045 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]]2236 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]]
2046 <tr>2237 <tr>
2047 <td>2238 <td>
2048 <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para>2239 <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para>
@@ -2106,7 +2297,76 @@
2106 </blockTable>2297 </blockTable>
2107 </section>2298 </section>
2108 2299
2109 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]]2300 <section>
2301 <blockTable colWidths="210.0,70.0,50.0,71.0,40.0,89.0" style="Table5"> [[( o.freight_allowed == True and o.company_id.packing_cost == False) or removeParentNode('blockTable')]]
2302 <tr>
2303 <td>
2304 <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para>
2305 </td>
2306 <td>
2307 <para style="P1">
2308 <font color="white"> </font>
2309 </para>
2310 </td>
2311 <td>
2312 <para style="P1">
2313 <font color="white"> </font>
2314 </para>
2315 </td>
2316 <td>
2317 <para style="P1">
2318 <font color="white"> </font>
2319 </para>
2320 </td>
2321 <td>
2322 <para style="P1">
2323 <font color="white"> </font>
2324 </para>
2325 </td>
2326 <td>
2327 <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para>
2328 </td>
2329 </tr>
2330 </blockTable>
2331
2332 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[( o.company_id.packing_cost and o.freight_allowed == True) or removeParentNode('blockTable')]]
2333 <tr>
2334 <td>
2335 <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para>
2336 </td>
2337 <td>
2338 <para style="P1">
2339 <font color="white"> </font>
2340 </para>
2341 </td>
2342 <td>
2343 <para style="P1">
2344 <font color="white"> </font>
2345 </para>
2346 </td>
2347 <td>
2348 <para style="P1">
2349 <font color="white"> </font>
2350 </para>
2351 </td>
2352 <td>
2353 <para style="P1">
2354 <font color="white"> </font>
2355 </para>
2356 </td>
2357 <td>
2358 <para style="P1">
2359 <font color="white"> </font>
2360 </para>
2361 </td>
2362 <td>
2363 <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para>
2364 </td>
2365 </tr>
2366 </blockTable>
2367 </section>
2368
2369 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]]
2110 <tr>2370 <tr>
2111 <td>2371 <td>
2112 <para style="terp_default_10">Dealers' Discount </para>2372 <para style="terp_default_10">Dealers' Discount </para>
@@ -2167,7 +2427,7 @@
2167 </tr>2427 </tr>
2168 </blockTable>2428 </blockTable>
2169 2429
2170 <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]2430 <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]]
2171 <tr>2431 <tr>
2172 <td>2432 <td>
2173 <para style="terp_default_10">Total</para>2433 <para style="terp_default_10">Total</para>
@@ -2230,7 +2490,7 @@
2230 <para style="terp_default_9">2490 <para style="terp_default_9">
2231 <font color="white"> </font>2491 <font color="white"> </font>
2232 </para>2492 </para>
2233 <blockTable colWidths="334.0,197.0" style="Table8">2493 <blockTable colWidths="334.0,205.0" style="Table8">
2234 <tr>2494 <tr>
2235 <td>2495 <td>
2236 <para style="terp_default_9">Declaration</para>2496 <para style="terp_default_9">Declaration</para>
22372497
=== modified file 'l10n_in_tax_retail_invoice/report/tax_invoice.sxw'
2238Binary files l10n_in_tax_retail_invoice/report/tax_invoice.sxw 2013-05-23 08:40:28 +0000 and l10n_in_tax_retail_invoice/report/tax_invoice.sxw 2013-06-20 10:57:25 +0000 differ2498Binary files l10n_in_tax_retail_invoice/report/tax_invoice.sxw 2013-05-23 08:40:28 +0000 and l10n_in_tax_retail_invoice/report/tax_invoice.sxw 2013-06-20 10:57:25 +0000 differ
=== added directory 'l10n_in_tax_retail_invoice/test'
=== added file 'l10n_in_tax_retail_invoice/test/purchase_order.yml'
--- l10n_in_tax_retail_invoice/test/purchase_order.yml 1970-01-01 00:00:00 +0000
+++ l10n_in_tax_retail_invoice/test/purchase_order.yml 2013-06-20 10:57:25 +0000
@@ -0,0 +1,42 @@
1-
2 In order to test the tax invoice reports defined on an invoice, I create a Purchase Order with cost price 13.0 and inward freight 5.0.
3-
4 !record {model: purchase.order, id: purchase_order_1}:
5 partner_id: base.res_partner_3
6 invoice_method: 'order'
7 inward_freight: 5.0
8 order_line:
9 - product_id: product.product_product_48
10 product_qty: 1.0
11 price_unit: 13.0
12-
13 I confirm the purchase order and supplier invoice is created.
14-
15 !workflow {model: purchase.order, ref: purchase_order_1, action: purchase_confirm}
16-
17 I select Purchase Freight and check that the untaxed Amount should be 13.0, and Total Amount should be 18.0.
18-
19 !python {model: purchase.order}: |
20 purchase = self.browse(cr,uid,ref('purchase_order_1'))
21 assert(purchase.amount_untaxed == 13.0), _('Untax Amount should be 13.0')
22 assert(purchase.inward_freight == 5.0), _('Inward Freight should be 5.0')
23 if purchase.company_id.freight:
24 assert(purchase.amount_total == 18.0), _('Amount should be 18.0')
25-
26 I check that supplier invoice is created or not after confirming purchase order.
27-
28 !python {model: purchase.order}: |
29 purchase_order_obj = self.browse(cr,uid,ref('purchase_order_1'))
30 invoice_id = self.pool.get('account.invoice').search(cr, uid, [('partner_id','=',purchase_order_obj.partner_id.id),('origin','=',purchase_order_obj.name)])
31 assert(invoice_id), _('Supplier Invoice should be created')
32-
33 In order to test PDF reports defined on invoice, we will print an tax Invoice Report.
34-
35 !python {model: account.invoice}: |
36 from openerp import netsvc, tools
37 import os
38 purchase_order_obj = self.pool.get('purchase.order').browse(cr,uid,ref('purchase_order_1'))
39 invoice_id = self.search(cr,uid,[('partner_id','=',purchase_order_obj.partner_id.id),('origin','=',purchase_order_obj.name)])
40 (data, format) = netsvc.LocalService('report.account.invoice.tax.excise').create(cr, uid, invoice_id, {}, {})
41 if tools.config['test_report_directory']:
42 file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
043
=== added file 'l10n_in_tax_retail_invoice/test/sale_order.yml'
--- l10n_in_tax_retail_invoice/test/sale_order.yml 1970-01-01 00:00:00 +0000
+++ l10n_in_tax_retail_invoice/test/sale_order.yml 2013-06-20 10:57:25 +0000
@@ -0,0 +1,69 @@
1-
2 In order to test the tax invoice reports defined on an invoice, we will create sale order with packing amount and dealers discount.
3 For that we have a VAT tax defined.
4-
5 !record {model: account.tax, id: tax_1}:
6 name: 'Vat'
7 tax_categ: 'vat'
8 amount: 0.04
9-
10 we have a Additional tax defined.
11-
12 !record {model: account.tax, id: tax_2}:
13 name: 'Additional'
14 tax_categ: 'other'
15 amount: 0.01
16-
17 Create one sale order for [ADPT] USB Adapter.
18-
19 !record {model: sale.order, id: sale_order_01}:
20 partner_id: base.res_partner_2
21 order_policy: 'prepaid'
22 order_line:
23 - name: USB Adapter
24 product_uom_qty: 1.0
25 price_unit: 18.0
26 packing_amount: 5.0
27 lst_price: 10.0
28 tax_id:
29 - tax_1
30 - tax_2
31-
32 I confirm sale order.
33-
34 !workflow {model: sale.order, action: order_confirm, ref: sale_order_01}
35
36-
37 I select Packing cost and check that the untaxed Amount should be 23.0, Tax should be 1.15, Total Amount is 24.15.
38-
39 !python {model: sale.order}: |
40 sale = self.browse(cr, uid, ref('sale_order_01'))
41 if sale.company_id.packing_cost:
42 assert(sale.amount_untaxed == 23.0), _('Untax Amount should be 23.0')
43 assert(sale.amount_tax == 1.15), _('Tax should be 1.15')
44 assert(sale.amount_total == 24.15), _('Amount should be 24.15')
45-
46 I check that the dealers discount should be 8.0.
47-
48 !python {model: sale.order}: |
49 sale = self.browse(cr, uid, ref('sale_order_01'))
50 assert(sale.dealers_disc == 8.0), _('Dealers discount should be 8.0')
51
52-
53 I check that customer invoice is created or not after confirming sale order.
54-
55 !python {model: sale.order}: |
56 sale_order_obj = self.browse(cr, uid, ref('sale_order_01'))
57 invoice_id = self.pool.get('account.invoice').search(cr, uid, [('partner_id','=',sale_order_obj.partner_id.id),('origin','=',sale_order_obj.name)])
58 assert(invoice_id), _('customer Invoice should be created')
59-
60 In order to test the PDF reports defined on an invoice, we will print an Tax Invoice Report.
61-
62 !python {model: account.invoice}: |
63 import netsvc, tools, os
64 sale_order_obj = self.pool.get('sale.order').browse(cr, uid, ref('sale_order_01'))
65 invoice_id = self.search(cr, uid, [('partner_id','=',sale_order_obj.partner_id.id),('origin','=',sale_order_obj.name)])
66 (data, format) = netsvc.LocalService('report.account.invoice.tax.excise').create(cr, uid, invoice_id, {}, {})
67 if tools.config['test_report_directory']:
68 file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
69