-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4135][ADD] account_invoice_line_salesperson #226
base: 12.0
Are you sure you want to change the base?
Conversation
@api.depends("sale_line_ids.order_id.user_id", "invoice_id.user_id") | ||
def _compute_salesperson(self): | ||
for line in self: | ||
line.user_id = line.invoice_id.user_id | ||
if line.sale_line_ids: | ||
line.user_id = line.sale_line_ids[0].order_id.user_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@api.depends("sale_line_ids.order_id.user_id", "invoice_id.user_id") | |
def _compute_salesperson(self): | |
for line in self: | |
line.user_id = line.invoice_id.user_id | |
if line.sale_line_ids: | |
line.user_id = line.sale_line_ids[0].order_id.user_id | |
@api.multi | |
@api.depends("sale_line_ids.order_id.user_id", "invoice_id.user_id") | |
def _compute_salesperson(self): | |
for line in self: | |
if line.invoice_type not in ("out_invoice", "out_refund"): | |
continue | |
if line.sale_line_ids: | |
line.user_id = line.sale_line_ids[0].order_id.user_id | |
continue | |
line.user_id = line.invoice_id.user_id |
18be208
to
fb63be9
Compare
<field name="invoice_type" invisible="1" /> | ||
<field name="user_id" attrs="{'invisible': [('invoice_type', 'not in', ['out_invoice', 'out_refund'])]}"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's redundant to consider invoice_type here. account.invoice_form
is only used for out_invoice and out_refund, IIUC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake. I thought they shared the same view like another versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review. 👍
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional and code review.
4135