
Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn
由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解
本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!
开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号
如果您登录系统碰到问题,请在微信公众号留言:
求助point_of_sale模块中pos_config的_check_cash_control
-
point_of_sale模块中pos_config的_check_cash_control中的
all(
(sum(int(journal.cash_control) for journal in record.journal_ids) <= 1)
for record in self.browse(cr, uid, ids, context=context)
)这个all中的迭代对像是啥?
新手求解 -
all是用来判断其输入的可遍历的对象的所有的值为True则其返回True否则为False
在你的例子中其迭代对象是一个True和False组成的Tuple,而True是满足sum的值为<=1的值,这个意思就是说在Pos configration中不能出现一个以上有cash_control的journal。
而事实上这个_check_cash_control也是用于下列的constraint中(_check_cash_control, "You cannot have two cash controls in one Point Of Sale !", ['journal_ids'])
-
谢谢