我的Python文件中有此方法
const { prop, path, toUpper, map, compose } = R
const baseObject = {
id: 1,
name: 'object-one',
info: {
items: [
{ name: 'item-one', url: '/images/item-one.jpg' },
]
},
}
// createObjectFromSpec :: { k: f(a) } -> a -> { k: b }
const createObjectFromSpec = spec => baseObj => R.map(f => f(baseObj), spec);
const createObjectTypeOne = createObjectFromSpec({
id: prop('id'),
name: prop('name'),
// image is a new prop not found on the base object
image: path(['info', 'items', 0, 'url']),
})
const createObjectTypeTwo = createObjectFromSpec({
id: prop('id'),
name: prop('name'),
// image is a new prop not found on the base object
itemName: path(['info', 'items', 0, 'name']),
})
console.log(
createObjectTypeOne(baseObject)
)
console.log(
createObjectTypeTwo(baseObject)
)
调用方法
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.25.0/ramda.min.js"></script>
<script src="https://codepen.io/synthet1c/pen/KyQQmL.js"></script>
错误
我遇到以下错误
@api.model
def get_wallet_balance(self, ID_number):
wallet_balance = 0.0
partner = self.env['res.partner'].sudo().search(
[('member_id_number', '=', ID_number)],limit=1
)
if partner:
wallet_balance = partner.wallet_balance
print 'wallet_balance========================',wallet_balance
return wallet_balance
我可以调用其他没有参数的方法。 谁能说我要去哪里错了?