Recalculate taxes on programatically created invoice in Odoo 12 - odoo

In odoo I have created an invoice with correct invoice line items ( including tax ). I am using a node module for this which calls the /web/dataset/call_kw endpoint in odoo.
My problem is, that the tax on the invoice is not updated after adding the line items. It remains 0. Can I force the recalculation of the invoice or must I calculate the total tax and set it on the invoice programatically?
I have tried to call the method button_reset_taxes() on the account.invoice object via the web api, but failed.
Error:
account.invoice has no attribute button_reset_taxes.

Related

Odoo Add Tax on invoice by Code but Total on Invoice not change

I am trying to add tax into invoice line by doing
discount_l.write({'tax_ids': tax_ids})
which did add tax into 'account_move_line' but the total of invoice did not change. I try debug and notice that onchange method did not trigger. I read some document and onchange only triggers on FORM. What should I do? I dont know how many onchange methods I need to call manually
The total will be automatically computed if you update the invoice lines using the invoice reference.
In the following example, we will use the new commands link function to update a specific invoice line tax_ids field:
Example:
invoice_id.write({'invoice_line_ids': [Command.update(invoice_line_id, {'tax_ids': tax_ids})]})

Value error expected singleton in Odoo

I have a module named uniform request, which contains a field named select product, which contains inherited data from another module named product. Product, when I select the product I want to purchase a button shows named send request to purchase, after selection a confirmation button shows and after confirming the request I have the option to make new quotation, but when I try to make the new quotation an error message shows:
ValueError: Expected singleton : product. Uom()
It seems you need to assign UoM (Unit of Measure) to the selected product, make sure that you insert a valid value of this field uom_id.

Cannot validate a non-balanced entry error on validate supplier invoice OpenERP 7

I have faced the warning pop on validate the supplier invoice with OpenERP 7
1 - select supplier invoice and select supplier
2 - Add Product in invoice line
3 - select Other Info Tab and Add Payment Terms
4 - Validate the invoice
When trying to validate an invoice the application issues an error below OpenERP Warning :
"You cannot validate a non-balanced entry.
Make sure you have configured payment terms properly.
The latest payment term line should be of the "Balance" type."
Warning message raise only when there are debit and credit balance will not be matched.
I am also follwing the below article
https://bugs.launchpad.net/openobject-addons/+bug/506521
Our customer using the old base addons for accouting related module in OpenERP V7
Also apply so many other patch on my existing addons for openerp V7
but not finding any solution relavent with this issue
Any one have idea what are the stapes need to stop my warning popup . or Is there any preconfiguration needed to solve my issue

Override email templates (mailalert module) in prestashop

We have an eshop in prestashop (1.6.1.12 version) with mail alerts module installed. The concept is to modify the email template in order to change the way some values are being displayed. In particular we would like to modify the new_order email notification (the one that the shop owner receive for every new order) removing the product links from the product list and display the shipping costs without tax (the total tax is visible on the next field of the email).
You have the template files in this directory:
/modules/mailalerts/mails/[your-language]

Odoo 10: How to create project tasks from sale orders?

I have set my odoo system according to the "User Doc" of How to create tasks from sales orders? and want to generate project tasks automating when a sale order containing "Service" type product was created.
However, it wasn't working even after I have tried severals times.
I didn't find the the "Track Service" item when I set up a "Service" product.
screen shot
Is this the reason which odoo system can't generate task automating? Or there some thing else cause the issue?
Anyone can give me some advice?
Thanks.
this answer will help to do your task in odoo version 10.
In order to get the track the **Create Tasks From Sales Orders** you follow the following steps.
Step : 1 Install the required applications / Configuration
Install the 3 following app
1. Sales Management
2. Project management
3. Time-sheet management
Step : 2 Create and set up a product
Note :
Now in case to of the service product unit of the measurement is used in hours. to configure that go to
Go to Configuration -> Settings -> Unit of measures -> check the
Some products may be sold/purchased in different unit of measures
(advanced) radio button)
Now , create the product with following details
To create the product Go to the Sales -> Product -> Create
- Name: Service Contract
- Product Type: Service
- Unit of Measure: Hours
as this all are the general setup shown on Image below
Next configure Track Service:
You will found this under Sales -> Sales -> Product -> Invoice ->
Select Create a task and track hours.
Note :
Link your task to an existing project or create a new one on the fly if the product is specific to one project. Otherwise, you can
leave it blank, odoo will then create a project per SO.
as your product is a service invocable by hours you have to set the units of measures of the product to hours as well.
Step : 3 Create the Sales Order
Once the product is set up, you can create a quotation or a sale order
with the related product. Once the quotation is confirmed and
transformed into a sale order, the task will be created.
Step : 4 Access the task generated from the sale order
On the Project module, your new task will appear :
either on a related project if you have selected one in the product form
either on a new project with the name of related the sale order as title
(you can easily change the name of the project by clicking on More ->
Settings)
as shown in below image.
The doc screenshot of the product form seems just wrong for Odoo 10. The track service option should be found in the page "Accounting" of a product. Maybe the module sale_timesheet has to be installed before.
If the system configuration is not working, then try creating tasks as follows manually in your code by inheriting sale.order model
Iterate over your order_line one2many field of sale.order and check any products are of type service, if the condition is satisfied then invoke the create function of the model project.task and pass the field(of project.task model) values as arguments