diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 44cf3afde69..0b2291224a9 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -91,7 +91,7 @@ - +
diff --git a/addons/account/test/price_accuracy00.yaml b/addons/account/test/price_accuracy00.yaml deleted file mode 100644 index a825700e4b7..00000000000 --- a/addons/account/test/price_accuracy00.yaml +++ /dev/null @@ -1,64 +0,0 @@ -- | - Tax Scenario: - In order to check that the accounting entries and tax engine works - efficiently with all kind of price accuracies we run this test scenario. -- - Given the price accuracy for the account module is configured with two - digits -- - !record {model: decimal.precision, id: product.decimal_account}: - digits: 2 -- - And we have a tax defined -- - !record {model: account.tax, id: tax196}: - name: Tax 19.6% - amount: &tax 0.196 -- - And we define an invoice with one invoice line with a tax of *tax -- - !record {model: account.invoice, id: invoice1}: &invoice - name: Precision Test - type: out_invoice - partner_id: base.xxx - address_contact_id: - address_invoice_id: - account_id: - invoice_lines: - - product_qty: &qty 11.11 - product_uom: product.product_unit - price_unit: &price 12.34 -- - When I press on the CREATE button on the invoice to open it. -- - # to be completed -- - Then I should see an account entry linked to this invoice. -- - !record {model: account.invoice, id: invoice1}: - test: bool(move_id) -- - # This is not working, find a way to do that in YAML, *qty is not - # interpreted because it's not a node. - And this account entry must have a credit equals to 163.70€ which is - equal to *qty x *price x (1 + *tax) -- - !record {model: account.invoice, id: invoice1}: - test: abs(move_id.credit - 163.70) < 0.000001 -- - And this account entry must have a credit equals to the debit -- - !record {model: account.invoice, id: invoice1}: - test: abs(move_id.debit - move_id.credit) < 0.000001 -- - Then, I change the precision of numbers to 3 digits. -- - !record {model: decimal.precision, id: product.decimal_account}: - digits: 3 -- - And I create another invoice with the same content. -- - !record {model: account.invoice, id: invoice2}: - *invoice -- - to be completed, etc. diff --git a/addons/account/test/price_accuracy00.yml b/addons/account/test/price_accuracy00.yml new file mode 100644 index 00000000000..48b5ceca35b --- /dev/null +++ b/addons/account/test/price_accuracy00.yml @@ -0,0 +1,92 @@ +- | + Tax Scenario: + In order to check that the accounting entries and tax engine works + efficiently with all kind of price accuracies we run this test scenario. +- + Given the price accuracy for the account module is configured with two + digits +- + !record {model: decimal.precision, id: product.decimal_account}: + digits: 2 +- + And we have a tax defined +- + !record {model: account.tax, id: tax196}: + name: Tax 19.6% + amount: &tax 0.196 + account_collected_id: account.a_recv + account_paid_id: account.a_recv +- + And we define an invoice with one invoice line with a tax of *tax +- + !record {model: account.invoice, id: invoice1}: &invoice + name: Precision Test + type: out_invoice + partner_id: base.res_partner_2 + address_invoice_id: base.res_partner_address_1 + account_id: account.a_recv + date_invoice: !eval time.strftime('%Y-%m-%d') + invoice_line: + - product_id: product.product_product_pc1 + quantity: &qty 11.11 + account_id: account.a_sale + uos_id: product.product_uom_unit + price_unit: &price 12.34 + name: test + invoice_line_tax_id: + - tax196 +- + When I press on the CREATE button on the invoice to open it. +- + !python {model: account.invoice}: | + self.action_move_create(cr, uid, [ref("invoice1")]) +- + Then I should see an account entry linked to this invoice. +- + !assert {model: account.invoice, id: invoice1}: + test: + - bool(move_id) +- + # This is not working, find a way to do that in YAML, *qty is not + # interpreted because it's not a node. + And this account entry must have a credit equals to 163.70€ which is + equal to *qty x *price x (1 + *tax) +- + !assert {model: account.invoice, id: invoice1}: + test: + - abs(sum(x.credit for x in move_id.line_id) - 163.97) < 0.000001 +- + And this account entry must have a credit equals to the debit +- + !assert {model: account.invoice, id: invoice1}: + test: + - abs(sum(x.credit - x.debit for x in move_id.line_id)) < 0.000001 +- + Then, I change the precision of numbers to 3 digits. +- + !record {model: decimal.precision, id: product.decimal_account}: + digits: 3 +- + And I create another invoice with the same content. +- + !record {model: account.invoice, id: invoice2}: + *invoice +- + When I press on the CREATE button on the invoice to open it. +- + !python {model: account.invoice}: | + self.action_move_create(cr, uid, [ref("invoice2")]) +- + !python {model: account.invoice}: | + invoice = self.browse(cr, uid, ref("invoice2")) + log(sum(x.credit for x in invoice.move_id.line_id)) + assert (sum(x.credit for x in invoice.move_id.line_id) - 163.968) < 0.000001, "Pas bon !!!" +- + !assert {model: account.invoice, id: invoice2}: + test: + - abs(sum(x.credit for x in move_id.line_id) - 163.968) < 0.000001 +- + !assert {model: account.invoice, id: invoice2}: + test: + - abs(sum(x.credit - x.debit for x in move_id.line_id)) < 0.000001 + diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 8bc6f56117d..6cd8952a804 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -295,9 +295,8 @@ class crm_case(osv.osv): section = (case.section_id.id or False) if section in s: st = case.stage_id.id or False - if st in s[section]: - stage_value = self.pool.get('crm.case.stage').read(cr, uid,s[section][st] , ['probability'], context) - self.write(cr, uid, [case.id], {'stage_id': s[section][st],'probability':stage_value['probability']}) + if st in s[section]: + self.write(cr, uid, [case.id], {'stage_id': s[section][st]}) return True def get_stage_dict(self, cr, uid, ids, context={}): @@ -318,9 +317,8 @@ class crm_case(osv.osv): if section in s: st = case.stage_id.id or False s[section] = dict([(v, k) for (k, v) in s[section].iteritems()]) - if st in s[section]: - stage_value = self.pool.get('crm.case.stage').read(cr, uid,s[section][st] ,['probability'], context) - self.write(cr, uid, [case.id], {'stage_id': s[section][st],'probability':stage_value['probability']}) + if st in s[section]: + self.write(cr, uid, [case.id], {'stage_id': s[section][st]}) return True diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index e9a8b555220..61763ce41ce 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -90,7 +90,7 @@