Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–21 unchanged (21 lines)
22 new_lots = []
23 sequence = self.production_id.product_id.lot_sequence_id
24 for lot_name in sorted(lots):
25 if lot_name in existing_lot_names:
26 continue
27 if sequence and lot_name == sequence.get_next_char(sequence.number_next_actual):
28 sequence.number_next_actual += 1
29 new_lots.append({
30 'name': lot_name,
31 'product_id': self.production_id.product_id.id
32 })
33 all_lots = existing_lots + self.env['stock.lot'].create(new_lots)
34 self.production_id.with_context(mrp_subcontracting=True).write({
…lines 35–47 unchanged (13 lines)

After

…lines 1–21 unchanged (21 lines)
22 new_lots = []
23 sequence = self.production_id.product_id.lot_sequence_id
24 for lot_name in sorted(lots):
25 if lot_name in existing_lot_names:
26 continue
27 if sequence and lot_name == sequence.get_next_char(sequence.number_next_actual):
28 sequence.sudo().number_next_actual += 1
29 new_lots.append({
30 'name': lot_name,
31 'product_id': self.production_id.product_id.id
32 })
33 all_lots = existing_lots + self.env['stock.lot'].create(new_lots)
34 self.production_id.with_context(mrp_subcontracting=True).write({
…lines 35–47 unchanged (13 lines)

Before

module
comment "# Part of Odoo. See LICENSE file for full copyright and lice"...
import_from_statement
from "from"
dotted_name
identifier "odoo"
import "import"
dotted_name
identifier "models"
class_definition
class "class"
identifier "MrpProductionSerials"
argument_list
( "("
attribute
identifier "models"
. "."
identifier "TransientModel"
) ")"
: ":"
block
expression_statement
assignment
identifier "_inherit"
= "="
string
string_start "'"
string_content "mrp.production.serials"
string_end "'"
function_definition
def "def"
identifier "action_apply"
parameters
( "("
identifier "self"
) ")"
: ":"
block
expression_statement
call
attribute
identifier "self"
. "."
identifier "ensure_one"
argument_list
( "("
) ")"
expression_statement
assignment
identifier "sbc_move"
= "="
call
attribute
attribute
identifier "self"
. "."
identifier "production_id"
. "."
identifier "_get_subcontract_move"
argument_list
( "("
) ")"
if_statement (+21 nodes collapsed)
expression_statement (+62 nodes collapsed)
expression_statement (+108 nodes collapsed)
expression_statement
assignment
identifier "existing_lot_names"
= "="
call
attribute
identifier "existing_lots"
. "."
identifier "mapped"
argument_list
( "("
string
string_start "'"
string_content "name"
string_end "'"
) ")"
expression_statement
assignment
identifier "new_lots"
= "="
list
[ "["
] "]"
expression_statement
assignment
identifier "sequence"
= "="
attribute
attribute
attribute
identifier "self"
. "."
identifier "production_id"
. "."
identifier "product_id"
. "."
identifier "lot_sequence_id"
for_statement
for "for"
identifier "lot_name"
in "in"
call
identifier "sorted"
argument_list
( "("
identifier "lots"
) ")"
: ":"
block
if_statement
if "if"
comparison_operator
identifier "lot_name"
in "in"
identifier "existing_lot_names"
: ":"
block
continue_statement
continue "continue"
if_statement
if "if"
boolean_operator
identifier "sequence"
and "and"
comparison_operator
identifier "lot_name"
== "=="
call
attribute
identifier "sequence"
. "."
identifier "get_next_char"
argument_list
( "("
attribute
identifier "sequence"
. "."
identifier "number_next_actual"
) ")"
: ":"
block
expression_statement
augmented_assignment
attribute
identifier "sequence"
. "."
identifier "number_next_actual"
+= "+="
integer "1"
expression_statement (+36 nodes collapsed)
expression_statement (+26 nodes collapsed)
expression_statement (+46 nodes collapsed)
expression_statement (+73 nodes collapsed)
return_statement
return "return"
call
attribute
attribute
identifier "sbc_move"
. "."
identifier "picking_id"
. "."
identifier "action_show_subcontract_details"
argument_list
( "("
) ")"

After

module
comment "# Part of Odoo. See LICENSE file for full copyright and lice"...
import_from_statement
from "from"
dotted_name
identifier "odoo"
import "import"
dotted_name
identifier "models"
class_definition
class "class"
identifier "MrpProductionSerials"
argument_list
( "("
attribute
identifier "models"
. "."
identifier "TransientModel"
) ")"
: ":"
block
expression_statement
assignment
identifier "_inherit"
= "="
string
string_start "'"
string_content "mrp.production.serials"
string_end "'"
function_definition
def "def"
identifier "action_apply"
parameters
( "("
identifier "self"
) ")"
: ":"
block
expression_statement
call
attribute
identifier "self"
. "."
identifier "ensure_one"
argument_list
( "("
) ")"
expression_statement
assignment
identifier "sbc_move"
= "="
call
attribute
attribute
identifier "self"
. "."
identifier "production_id"
. "."
identifier "_get_subcontract_move"
argument_list
( "("
) ")"
if_statement (+21 nodes collapsed)
expression_statement (+62 nodes collapsed)
expression_statement (+108 nodes collapsed)
expression_statement
assignment
identifier "existing_lot_names"
= "="
call
attribute
identifier "existing_lots"
. "."
identifier "mapped"
argument_list
( "("
string
string_start "'"
string_content "name"
string_end "'"
) ")"
expression_statement
assignment
identifier "new_lots"
= "="
list
[ "["
] "]"
expression_statement
assignment
identifier "sequence"
= "="
attribute
attribute
attribute
identifier "self"
. "."
identifier "production_id"
. "."
identifier "product_id"
. "."
identifier "lot_sequence_id"
for_statement
for "for"
identifier "lot_name"
in "in"
call
identifier "sorted"
argument_list
( "("
identifier "lots"
) ")"
: ":"
block
if_statement
if "if"
comparison_operator
identifier "lot_name"
in "in"
identifier "existing_lot_names"
: ":"
block
continue_statement
continue "continue"
if_statement
if "if"
boolean_operator
identifier "sequence"
and "and"
comparison_operator
identifier "lot_name"
== "=="
call
attribute
identifier "sequence"
. "."
identifier "get_next_char"
argument_list
( "("
attribute
identifier "sequence"
. "."
identifier "number_next_actual"
) ")"
: ":"
block
expression_statement
augmented_assignment
attribute
call
attribute
identifier "sequence"
. "."
identifier "sudo"
argument_list
( "("
) ")"
. "."
identifier "number_next_actual"
+= "+="
integer "1"
expression_statement (+36 nodes collapsed)
expression_statement (+26 nodes collapsed)
expression_statement (+46 nodes collapsed)
expression_statement (+73 nodes collapsed)
return_statement
return "return"
call
attribute
attribute
identifier "sbc_move"
. "."
identifier "picking_id"
. "."
identifier "action_show_subcontract_details"
argument_list
( "("
) ")"