Stéphane Bidoul (Acsone) has proposed merging
lp:~openerp-community-testers/openobject-addons/trunk-bug1048305 into
lp:openobject-addons.
Requested reviews:
qdp (OpenERP) (qdp)
Related bugs:
Bug #1048305 in OpenERP Addons: "hr_timesheet_invoice: Created invoice from
bill task work ignore the default taxes."
https://bugs.launchpad.net/openobject-addons/+bug/1048305
For more details, see:
https://code.launchpad.net/~openerp-community-testers/openobject-addons/trunk-bug1048305/+merge/132073
--
https://code.launchpad.net/~openerp-community-testers/openobject-addons/trunk-bug1048305/+merge/132073
Your team OpenERP Community Testers is subscribed to branch
lp:~openerp-community-testers/openobject-addons/trunk-bug1048305.
=== modified file 'hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml'
--- hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml 2012-07-26 11:39:14 +0000
+++ hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml 2012-10-30 11:40:58 +0000
@@ -69,6 +69,7 @@
assert aline.invoice_id == invoice_id, "Invoice doesn't match the one at analytic line"
# The expected amount is hard coded here, please keep updated:
assert invoice_id.amount_untaxed == 187.5, "Invoice amount mismatch: %s" % invoice_id.amount_untaxed
+ assert invoice_id.amount_tax == 28.13, "Invoice tax mismatch: %s" % invoice_id.amount_tax
-
I create final invoice for this analytic account.
-
=== modified file 'hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py'
--- hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2012-10-28 15:15:37 +0000
+++ hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2012-10-30 11:40:58 +0000
@@ -49,7 +49,6 @@
# }
def invoice_cost_create(self, cr, uid, ids, data=None, context=None):
analytic_account_obj = self.pool.get('account.analytic.account')
- res_partner_obj = self.pool.get('res.partner')
account_payment_term_obj = self.pool.get('account.payment.term')
invoice_obj = self.pool.get('account.invoice')
product_obj = self.pool.get('product.product')
@@ -115,7 +114,7 @@
for product_id, user_id, factor_id, qty, uom, line_name in cr.fetchall():
if data.get('product'):
- product_id = data['product'][0]
+ product_id = data['product'][0]
product = product_obj.browse(cr, uid, product_id, context=context2)
if not product:
raise osv.except_osv(_('Error!'), _('There is no product defined for the line %s. Please select one or force the product through the wizard.') % (line_name))
@@ -132,7 +131,7 @@
general_account = product.product_tmpl_id.property_account_income or product.categ_id.property_account_income_categ
if not general_account:
raise osv.except_osv(_("Configuration Error!"), _("Please define income account for product '%s'.") % product.name)
- taxes = product.taxes_id
+ taxes = product.taxes_id or general_account.tax_ids
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
curr_line = {
'price_unit': price,
@@ -211,7 +210,7 @@
data = context and context.get('active_ids', [])
for analytic in analytic_obj.browse(cr, uid, data, context=context):
if analytic.invoice_id:
- raise osv.except_osv(_('Warning!'), _("Invoice is already linked to some of the analytic line(s)!"))
+ raise osv.except_osv(_('Warning!'), _("Invoice is already linked to some of the analytic line(s)!"))
def do_create(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids, [], context=context)[0]
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp