Skip to content

Commit

Permalink
[MIG] sale_stock_picking_invoicing: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Dec 2, 2024
1 parent 7e02b71 commit edbd32f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sale_stock_picking_invoicing/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "AGPL-3",
"author": "Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-invoicing",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"maintainers": ["mbcosta", "renatonlima"],
"depends": [
"sale_management",
Expand Down
9 changes: 6 additions & 3 deletions sale_stock_picking_invoicing/tests/test_sale_stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_01_sale_stock_return(self):
stock_picking = self.so.picking_ids

# compare sale.order.line with stock.move
stock_move = stock_picking.move_lines
stock_move = stock_picking.move_ids
sale_order_line = self.so.order_line

sm_fields = [key for key in self.env["stock.move"]._fields.keys()]
Expand Down Expand Up @@ -169,7 +169,7 @@ def test_picking_sale_order_product_and_service(self):
"sale_stock_picking_invoicing.main_company-sale_order_2"
)
# Necessary to get the currency
sale_order_2.onchange_partner_id()
# sale_order_2.onchange_partner_id()
sale_order_2.action_confirm()
# Method to create invoice in sale order should work only
# for lines where products are of TYPE Service
Expand Down Expand Up @@ -262,6 +262,9 @@ def test_picking_sale_order_product_and_service(self):
"__last_update",
# Field sequence add in creation of Invoice
"sequence",
"currency_id",
"analytic_precision",
"display_type",
]

common_fields = list(set(acl_fields) & set(sol_fields) - set(skipped_fields))
Expand All @@ -284,7 +287,7 @@ def test_picking_sale_order_product_and_service(self):
picking_devolution = self.return_picking_wizard(picking)

self.assertEqual(picking_devolution.invoice_state, "2binvoiced")
for line in picking_devolution.move_lines:
for line in picking_devolution.move_ids:
self.assertEqual(line.invoice_state, "2binvoiced")

self.picking_move_state(picking_devolution)
Expand Down
15 changes: 8 additions & 7 deletions sale_stock_picking_invoicing/wizards/stock_invoice_onshipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ def _get_invoice_line_values(self, moves, invoice_values, invoice):
if move.sale_line_id:
# Vals informed in any case
values["sale_line_ids"] = [(6, 0, moves.sale_line_id.ids)]
values[
"analytic_account_id"
] = moves.sale_line_id.order_id.analytic_account_id.id
values["analytic_tag_ids"] = [
(6, 0, moves.sale_line_id.analytic_tag_ids.ids)
]
# values[
# "analytic_account_id"
# ] = moves.sale_line_id.order_id.analytic_account_id.id
# values["analytic_tag_ids"] = [
# (6, 0, moves.sale_line_id.analytic_tag_ids.ids)
# ]
# Refund case don't get values from Sale Line Dict
# TODO: Should get any value?
if self._get_invoice_type() != "out_refund":
Expand All @@ -178,7 +178,6 @@ def _get_invoice_line_values(self, moves, invoice_values, invoice):

# Fields to remove
vals_to_remove = {
"display_type",
"name",
"product_id",
"product_uom_id",
Expand All @@ -191,6 +190,8 @@ def _get_invoice_line_values(self, moves, invoice_values, invoice):
# another fields
"__last_update",
"display_name",
"currency_id",
"analytic_precision",
}
sale_line_values_rm = {
k: sale_line_values[k]
Expand Down

0 comments on commit edbd32f

Please sign in to comment.