Skip to Content
Menu
This question has been flagged
11 Replies
2787 Views

Hi,

I'm using Odoo 11.

The groups account invoicing and account manager cannot see the column discount on invoice tree.

I found this code in the account module:

<field name="discount" groups="base.group_no_one"/>

So I tried chaging groups like this:

<xpath expr="/tree/field[@name='discount']" position="attributes">
<attribute name="groups">account.group_account_invoice</attribute>
</xpath>

But it's not working. Any idea how to do this?

Update:

I found that this field is visible only in debug mode (for admin and all the other users).

This makes no sense, an invoice has to have a discount column for a normal user.



Avatar
Discard
Best Answer

Hi,

follow the below steps to get the discount on invoice line for any users

Go to settings->users->select the required user->enable the Boolean field Discount on lines

Regards

Avatar
Discard
Author

Yes, I did that, didn't work.

Best Answer

Change the xpath expression to the following.

<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='discount']" position="attributes">
    <attribute name="groups">account.group_account_invoice</attribute>
</xpath>


Avatar
Discard
Author

I inherit the view "account.view_invoice_line_tree", and I'm accessing other fields in the tree without problem. So that's not the correct way to access to the field discount.

Try setting the priority of your customized view to a higher number like 100 so that the customization gets applied last.

Author

Changed the priority, but that didn't work.

Check whether there is another "inherited" view that is overriding your customization.

Best Answer

Hi,

If only your accounts admin want to see discount on invoices,  Then try like below:

<field name="discount" groups="account.group_account_manager"/>

Avatar
Discard
Author

Yes, I tried that but it's not working.

check the members in group and verify desired members are there

Author

They are there.

Best Answer

You can replace it field with your own field.


<xpath expr="/tree/field[@name='discount']" position="replace">
<field name="discount" groups="account.group_account_invoice"/>   
</xpath>
Avatar
Discard
Author

Yes, I tried that too but it's not working :-(

Then remove the group from field and check

Author

Tried that, still not working.

Related Posts Replies Views Activity
1
Jan 23
7558
0
Mar 15
2717
1
Nov 21
4293
2
Sep 21
8235
6
Jan 21
43063