Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
810 Zobrazení

I want the ability to create a customer invoice directly from a project task and link the task to the customer invoice. 

Avatar
Zrušit
Autor Nejlepší odpověď
  1. Activate Studio and Create a new many2one field on the account.move model in the invoice form view. 


2) Next create a smart button on the task model that points to the field "Related Task" which we just created on the Journal Entry Model (account.move)


3) Next activate developer mode by going into Settings > activate the developer mode.


4) Come back to the task and click back on the smart button created. 

5) Next click on the bug icon (visible only in developer mode) on the view, and then click on "Edit Action". This will open a Window action for that view. 

6) In such cases, by default Odoo will let you only create a manual journal entry when such smart buttons are used. But this can be changed by updating the context and the domain on this window action. Below is the default context and domain:


So here are the following updates required: 

Before Domain: [('x_studio_related_task', '=', active_id)]

Updated Domain: [('x_studio_related_task', '=', active_id),('move_type', '=', 'out_invoice')]


Before Context: {'search_default_x_studio_related_task': active_id,'default_x_studio_related_task': active_id}

Updated Context: {'search_default_x_studio_related_task': active_id,'default_x_studio_related_task': active_id,'default_move_type': 'out_invoice'}

Note: The studio fields can vary from database to database, so make sure that the field names are correct. In this case, we are keeping the existing domain and context created by studio as it is and only adding more conditions to it. 

7) Now that the context and domain has been set, when you click "New" Odoo would create a customer invoice for you and link the task to the customer invoice.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
srp 24
502
1
srp 24
690
1
srp 24
623
1
bře 25
346
1
dub 24
1072