Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0] pos_debt_notebook: fix some bugs #1160

Open
wants to merge 1 commit into
base: 10.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pos_debt_notebook/data/demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<record id="product_credit_product" model="product.product">
<field name="name">Credits top-up</field>
<field name="default_code">POS-DEBT</field>
<field name="default_code">POS-DEBT-CREDIT</field>
<field name="sale_ok" eval="True"/>
<field name="available_in_pos" eval="True"/>
<field name="list_price">1</field>
Expand Down
1 change: 1 addition & 0 deletions pos_debt_notebook/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def init_debt_journal(self):
'code': 'XDEBT',
'user_type_id': self.env.ref('account.data_account_type_current_assets').id,
'company_id': user.company_id.id,
'reconcile': True,
})
self.env['ir.model.data'].create({
'name': 'debt_account_for_company' + str(user.company_id.id),
Expand Down
2 changes: 1 addition & 1 deletion pos_debt_notebook/static/src/js/pos.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ odoo.define('pos_debt_notebook.pos', function (require) {
var order = self.pos.get_order();
if (order) {
var lastorderline = order.get_last_orderline();
if (lastorderline === null && self.pos.config.debt_dummy_product_id){
if (lastorderline === undefined && self.pos.config.debt_dummy_product_id){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected use of undefined no-undefined

var dummy_product = self.pos.db.get_product_by_id(
self.pos.config.debt_dummy_product_id[0]);
order.add_product(dummy_product, {'price': 0});
Expand Down