Hide quantity and unit price on quotation and invoice print (pdf, etc.) with OpenERP (oDoo) - odoo

I'm not selling product but services and I would like to know if it's possible to hide the unit price and the quantity when I send/print a quotation or an invoice to a customer with OpenERP (v 7.0).
I just want the final customer to know the price and not all the details.
Do you have any idea how I could do that ?
Thanks

It will hide the unit price of product if product type is service other type will be print in report.
try this code,
<para style="terp_default_Right_9">[[ line.product_id.type=="service" and removeParentNode('para') ]] [[ formatLang(line.price_unit , digits=get_digits(dp='Product Price'))]]</para>
Hope this will help you.

Related

How can I set the pricelist discount to a product when I create a sale order line? In Odoo 9

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.

Prestashop Tax Off When VAT Number Inserted

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.

Auto generating a purchase order when a product (with quantity 0) is ordered

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

Aditionnal price to product in prestashop

I am selling drinks in bottles that have a deposit price. The customer has to pay that amount, but can get it back by bringing the bottles to a supermarket. I would like to show the product price without the deposit in the product pages, but when the user checks out his cart, this amount needs to be added to the cart for each item having a deposit. Here are some extra info:
Not all products have a deposit
The deposit price depends on the product
I managed to add a "deposit" field to the backoffice in the product page:
http://oi57.tinypic.com/6p9s80.jpg
But it seems that changing the whole workflow of the cart check out would be quite a pain. Is there any easy way to achieve this task?
Thanks !
easiest way to do what you want it is using "product attributes combinations" + little code changes, step by step:
create product attribute e.g. "deposit"
add value to it, any,e.g. "yes"
in product create combination with "deposit: yes", set price impact value as you need, e.g. "$10" and set it as default combination
to show on product page price without "deposit" change in themes/themename/js/product.js in function updatePrice() find lines
// Apply combination price impact
// 0 by default, +x if price is inscreased, -x if price is decreased
basePriceWithoutTax = basePriceWithoutTax + +combination.price;
and wrap it into condition:
if( your_attribute_id != combination.attributes[0] ) {
basePriceWithoutTax = basePriceWithoutTax + +combination.price;
}
but in cart you will see full price.
UPD:
I see no good way to do it in template, without core changes, so if you need it (solution also not ideal)
file controllers/front/CategoryController.php (use override) method assignProductList() change code block to next view:
foreach ($this->cat_products as &$product) {
if ($product['id_product_attribute'] && isset($product['product_attribute_minimal_quantity']))
$product['minimal_quantity'] = $product['product_attribute_minimal_quantity'];
$combination = new Combination($product['id_product_attribute']);
$attributes = $combination->getAttributesName($this->context->language->id);
foreach ($attributes as $attribute) {
if(your_attribute_id == $attribute['id_attribute'])
$product['price_tax_exc'] -= $combination->price;
}
}
you will need to repeat it for all lists controllers that you use (and you can do not use foreach but access to array element by index like you already did), in any case solution very project specific, just quick fix, in common case be better use other ways.

Tax Calculate Incorrectly - WooCommerce

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