we have this situation after odoo migration from 10 to 13.
as you can see the taxes equal the total amount, when on the lines the tax is 0%.
I have tried with:
rec._compute_invoice_taxes_by_group()
rec._compute_amount()
rec._recompute_dynamic_lines(rec)
rec._onchange_tax_totals_json()
but nothing changes, the _compute_amount works for untaxed and total amount, but amount_by_group (Taxes field on the form) doesnt change.
Any suggestions? Which function we can trigger on the account.move so that taxes on total get updated?
Thanks a lot
Related
I create a wizard that change price and quantity for each product but the amount_untaxed, tax_amount and total amount unchanged and journal entries are unbalanced. how to resolve that?
You should call _onchange_price_subtotal() on every changed invoice line (model account.move.line) to trigger the recomputation. The recomputation is only implemented for changes in the view, that's why it's isn't triggered when using a wizard. But the implementation can be used in the wizard, too, without any problems.
strong text_onchange_price_subtotal doesn't work. But
current_invoice_lines = rec.order_id.line_ids.filtered(lambda line: not line.exclude_from_invoice_tab)
others_lines = rec.order_id.line_ids - current_invoice_lines
if others_lines and current_invoice_lines - rec.order_id.invoice_line_ids:
others_lines[0].recompute_tax_line = True
rec.order_id.line_ids = others_lines + rec.order_id.invoice_line_ids
rec.order_id._onchange_recompute_dynamic_lines()
After adding the above code on account.move ... journal entries are balanced but tax_amount still unchanged?
I have a function who retrieves sale orders from an external server.
Then, I insert each sale order with order lines in the odoo database.
Everything is inserted fine, except the discount.
I have the pricelist in the sale order, with a discount (for example, a discount of 10% in every product), but in all the sale order lines the discount is 0%.
If I add a sale order line manually, the discount appears correctly (10%).
This is my code:
vals = {}
vals['order_id'] = downloaded_sale_order_id
vals['product_id'] = downloaded_product_id
vals['product_uom'] = downloaded_product_uom
new_line_id = self.env['sale.order.line'].create(vals)
I have entered in debug mode and realized that if I call some of these functions after the creation, the discount is applied
Option 1:
new_line_id.product_id_change()
Option 2:
new_line_id.product_uom_change()
But... why they are not called when I launch the create order?
Am I missing something in the code?
You have following options for set discount inside the sale order line while creating it from external server source.
1) Just set discount as like other parameter like uom, product, price etc from the source data of external server if you got discount value from their.
2) You have to call product or uom onchange method to set the discount based on the onchange calling and this is the default and safe method to set most of the data according to the onchange. It will not miss any special fields which are inside any customization with onchange method. I specially recommend this method to use if any discount data is not coming from external server source.
3) You can manage manually calculation of discount based on the external server source like price and qty etc. And set it inside sale order line.
I hope this is very helpful to you. Do not hesitate to ask any thing if not clear.
In my shop, when a user inserts a VAT number, the tax value desapears. I understand its comon practice abroad. But here in Portugal, the tax value is allways present.
I tried with Vat module and normal "NIF" field, but neither appears with tax value, or in the final invoice.
Im running, prestashop 1.6.0.8.
Someone with the same problem as me, another portuguese, says it got it workgin doing the folloying instrutions from a spanish tutorial:
In controllers/AuthController.php
Change
If ($country->need_identification_number && (!Tools::getValue(‘dni’) || !Validate::isDniLite(Tools::getValue(‘dni’))))
To
//if ($country->need_identification_number && (!Tools::getValue(‘dni’) || !Validate::isDniLite(Tools::getValue(‘dni’))))
if (!Validate::isDniLite(Tools::getValue(‘dni’)))
And in “controllers/”AddressController.php,
Change
if ($country->isNeedDni() && (!Tools::getValue(‘dni’) || !Validate::isDniLite(Tools::getValue(‘dni’))))
To
//if ($country->isNeedDni() && (!Tools::getValue(‘dni’) || !Validate::isDniLite(Tools::getValue(‘dni’))))
if (!Validate::isDniLite(Tools::getValue(‘dni’)))
But this code is for 1.5.x presta and mine is 1.6.0.8 and i guess dni is ther tax name.
Heres the source: http://postly.elnostreraco.com/como-hacer-el-dni-opcional-en-prestashop-y-por-que-desconfiar-si-te-hacen-tocar-codigo-base/
When using the VAT Module you can select a country. For users from that country (the one you selected in the module config), VAT will be added. For users from other countries, VAT will not be calculated, which, i believe, is in accordance with EU Law.
From here:
Your PrestaShop is misconfigured. When no "Your country" set in module "vatnumber" and your customer fill in the vat_number field, presta shop will force tax-free price.
I've selected country in this module (but not vat number validation) and it worked - user enter vat code or not, VAT is applied.
When the product has quantity on hand equal to zero, and customer orders this product, then, we need Odoo to generate a purchase order automatically for this product.
Odoo is not generating the automatic PO. We have Odoo 8.
As for an example, I created a test product. I ticked "Buy" check box, and unticked the"Make to order" check box. I added a vendor (has an address) on the product as follows:
Supplier: Old Stocks -
Delivery Lead Time: 0 -
Minimal Quantity: 1.00
I also created a reordering rule for this product:
Name: PO/8406724
Product: [9781452555508] 0.0.0.0 Would Our Legacy Survive?
Warehouse: Amman Stock -
Location: AmmWH/Stock -
Minimum Quantity: 5.000 -
Maximum Quantity: 20.000 -
Quantity Multiple: 1.000
I made a purchase order for this product, and transferred the delivery order. The quantity on hand became 4 (less than the min. quantity in the reordering rule). Run the schedulers from Warehouse -> Run Schedulers. However, the RfQ was not created.
What should I do to get an RfQ auto-generated, when the there is sales order for a product with "Quantity on hand" equal to zero?
Thanks you :)
I tried on V9(sorry don't have V8), and it works perfectly.
I follow that process:
Odoo Tuto for minimum stock rule
Can you try it ?
Regards,
FTK
All
I am running the WordPress 3.4.1 with the WooCommerce 1.5.8, as of this writing.
i just more confuse in Tax Amount
I need help with a Woocommerce problem.
Woocommerce has a "taxable" status for shipping. This option should include tax calculation on shipping (which has to be shown by law in the Netherlands).
However I have selected this option, however the system only calculations tax on the items products, NOT on the shipping costs.
So the tax calculation should be: 21% of (product price + shipping costs) while now it is 21% of product price.
So the problem is, the tax amount now is 21% of the product: 99.95 - (99.95/1.21) = 17.35.
In the shipping settings in woocommerce you can set your shipping to be added to tax calculation (tax status: taxable).
If this option is selected, the tax calculation should actually be:
product costs + shipping costs / ((product costs + shipping costs)/1.21).
So the total of products + shipping = 105.90.
Which means the tax calculation should be 105.90 - (105.90/1.21) = 18.38
Right now
it calculates 99.95 - (99.95/1.21) =17.35
I would like it to calculate 105.90 -(105.90/1.22) = 18.38.
Anyone Help Please ???
After too many research I got solution and its so simple...
Follow below steps..
1)Go to woocommerce > settings.
2)Under Tax tab,there are Tax Options and Tax rates links available.Under Tax options,select shipping tax class..!
3)In Tax rates,click on your previously selected tax class and just checked checkbox under shipping column..
So, Now your tax calculation is: 21% of (Cart Subtotal + shipping costs)..
For detail with screenshots please visit : http://maishidh.blogspot.in/
I was looking though the docs and it seems to me you might need some hard coding done. Here are the API documentation in regards of Woo commerce Tax Api. Look at line 503 and line 508. Maybe change those variables and see what you might get.
http://docs.woothemes.com/wc-apidocs/source-class-WC_Tax.html#_calc_shipping_tax