Skip to content
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

Open
wants to merge 2 commits into
base: 12.0
Choose a base branch
from

Conversation

AungKoKoLin1997
Copy link
Contributor

Comment on lines 14 to 21
@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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@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

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 4135-account_invoice_line_salesperson branch from 18be208 to fb63be9 Compare July 17, 2024 07:29
Comment on lines 9 to 10
<field name="invoice_type" invisible="1" />
<field name="user_id" attrs="{'invisible': [('invoice_type', 'not in', ['out_invoice', 'out_refund'])]}"/>
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review. 👍

Copy link

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

Copy link
Contributor

@kanda999 kanda999 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants