-
Notifications
You must be signed in to change notification settings - Fork 1
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
[3438][3894][IMP] account_move_obc_csv #55
Conversation
124957b
to
7b4d10a
Compare
7b4d10a
to
d0531e2
Compare
# Group records by picking_id | ||
for _p, grouped_records in groupby( | ||
sorted_records, key=lambda r: r.stock_move_id.picking_id.id | ||
): | ||
first_record = True | ||
for record in grouped_records: | ||
vals_dict = self._get_report_vals_dict(record) | ||
if first_record: | ||
vals_dict[1]["GL0010000"] = "*" | ||
first_record = False | ||
for _k, v in sorted(vals_dict.items()): | ||
writer.writerow(v) | ||
record.is_exported = True |
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.
We need to consider the non-inventory journal entries (e.g. those from vendor bills). The first line need to be marked with *
for those as well.
# Group records by picking_id | |
for _p, grouped_records in groupby( | |
sorted_records, key=lambda r: r.stock_move_id.picking_id.id | |
): | |
first_record = True | |
for record in grouped_records: | |
vals_dict = self._get_report_vals_dict(record) | |
if first_record: | |
vals_dict[1]["GL0010000"] = "*" | |
first_record = False | |
for _k, v in sorted(vals_dict.items()): | |
writer.writerow(v) | |
record.is_exported = True | |
picking = self.env["stock.picking"] | |
for record in sorted_records: | |
vals_dict = self._get_report_vals_dict(record) | |
first_record = False | |
record_picking = record.stock_move_id.picking_id | |
if not record_picking: | |
first_record = True | |
elif picking != record_picking: | |
first_record = True | |
picking = record_picking | |
if first_record: | |
vals_dict[1]["GL0010000"] = "*" | |
for _k, v in sorted(vals_dict.items()): | |
writer.writerow(v) | |
record.is_exported = True |
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.
Should be good, but we haven't added consideration to consolidate journal entries of manufacturing orders. @rinaldifirdaus Please check with the client if this should be covered in this update.
Hi @AungKoKoLin1997 , client request to add the consideration to consolidate the JE of Manufacturing order as well. could you please help to update this PR to handle this request? thanks! |
If I am not mistaken, there is no partner_id field in MO. So, when we create MO, the generated stock_move and JE will not be assigned partner_id. Customer wants which value to be partner_ref for MO? |
@AungKoKoLin1997 , sorry to confuse you, but this request is about giving "" only for the first line of the same transfer/mo. currently all line on the report of same MO is having "" . could you please check the behavior? |
@AungKoKoLin1997 I have updated the code to slightly improve the readability by flipping the conditions, and also to fix an issue with record sorting - production ids need to be considered or the journal entries from the same MO can be split apart. @rinaldifirdaus Please go ahead and apply the change to the staging server. |
3438
3894
OBC journal entry (stock journal entries from pickings and MOs are grouped into one
OBC journal entry picking/MO).
for journal envries from subcontracting MOs.