import qrcode
from odoo import api, fields, models
from odoo.addons.product.models import product
from odoo.addons.stock.models import stock_location
class Empqr(models.Model):
_name = "empqr"
_inherit = ['mail.thread', 'mail.activity.mixin']
_description = "QR Code"
issued_date = fields.Datetime(string='Date', default=fields.Datetime.now)
e_id = fields.Many2one('hr.employee', string="Employee Name", tracking=True)
p_id = fields.Many2one('product.product', string="Product Name", tracking=True)
department_id = fields.Many2one('hr.department', string='Department')
# q_id = fields.Many2one('product.product', string='Department')
quan = fields.Float(string='Quantity')
name = fields.Char('hr.employee', related='e_id.name', readonly=True)
department = fields.Char('hr.department', related='department_id.name', readonly=True)
products = fields.Char('product.product', related='p_id.name', readonly=True)
# qty = fields.Float('product.product', related='q_id.qty_available', readonly=True)
category = fields.Many2one('product.category', string="Category")
loc_id = fields.Many2many("stock.warehouse", string="Main Location")
# print("....................", qty)
def change_release_date(self):
print(",,,,,,,,",self.p_id)
quant_obj = self.env['product.product']
qty_available = quant_obj._search_product_quantity(0,'>',self.products)
print("qty_available..........................", qty_available)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
3058
Lượt xem
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 2 25
|
1283 | ||
|
2
thg 1 24
|
19804 | ||
|
2
thg 12 22
|
2879 | ||
|
0
thg 5 23
|
448 | ||
Duplicate Products Tree View
Đã xử lý
|
|
1
thg 11 22
|
2433 |