あなたが何を求めているのか完全にはわかりません。13 行の発注書がある場合、13 行の数量フィールドの合計を発注書のフィールドに表示する必要があるということですか?
その場合は、 purchase.order モデルを拡張し、注文明細を反復処理して数量を合計する機能フィールドを追加する必要があります。
あなたの列は次のようになります。
'total_quantity': fields.function(_get_total_quantity, type='float', method = True, string = 'Total Quantity', readonly = True),
あなたの方法は次のようになります:
def _get_total_quantity(self, cr, uid, ids, field, args, context = None):
res = {}
for po in self.browse(cr, uid, ids, context = context):
res[po.id] = sum([x.quantity for x in po.order_line])
return res
注文書ラインの one2many on purchase.order の名前が「order_line」であることを確認してください。私は記憶からこれを行っていますが、列名を思い出せません。