跳至内容
菜单
此问题已终结
1 回复
687 查看

I want the ability to create a vendor bill directly from a project task and link the task to the vendor bill.

形象
丢弃
编写者 最佳答案
  1. Activate Studio and Create a new many2one field on the account.move model in the 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', '=', 'in_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': 'in_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.

形象
丢弃
相关帖文 回复 查看 活动
1
8月 24
498
1
8月 24
617
1
10月 24
805
1
3月 25
346
1
4月 24
1068