-
-
Notifications
You must be signed in to change notification settings - Fork 581
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_invoice_pay: store POS session in payment record #1457
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Предыдущий функционал не теряется, а только добавляется новая информация. В целом норм
@@ -5,7 +5,7 @@ | |||
"summary": """Handle the payment process for Sale Orders/Invoices over Point of Sale""", | |||
"category": "Point of Sale", | |||
"images": ["images/pos_invoice_pay_main.png"], | |||
"version": "10.0.1.0.6", | |||
"version": "10.0.1.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше капитально поменять версию, т.к. там поля добавляются и нужно нажимать "Обновить модуль"
"version": "10.0.1.1.0", | |
"version": "10.0.2.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
там поля добавляются и нужно нажимать "Обновить модуль"
https://gitlab.com/itpp/handbook/-/blob/master/technical-docs/__manifest__.md#version
The x.y.z version numbers follow the semantics breaking.feature.fix:
- x increments when the data model or the views had significant
changes. Data migration might be needed, or depending modules might
be affected.
- y increments when non-breaking new features are added. A module
upgrade will probably be needed.
Попадает под y
.
@@ -66,9 +67,15 @@ def process_invoices_creation(self, sale_order_id): | |||
class AccountPayment(models.Model): | |||
_inherit = "account.payment" | |||
|
|||
paid_by_pos = fields.Boolean(default=False) | |||
paid_by_pos = fields.Boolean(compute="_compute_paid_by_pos", store=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если поле не используется для поиска\фильтрации, то не обязательно сохранять в таблице значения
paid_by_pos = fields.Boolean(compute="_compute_paid_by_pos", store=True) | |
paid_by_pos = fields.Boolean(compute="_compute_paid_by_pos") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это поле используется для поиска
pos-addons/pos_invoice_pay/report/report.py
Lines 33 to 39 in 8b16c4d
payments = self.env["account.payment"].search( | |
[ | |
("payment_date", ">=", date_start), | |
("payment_date", "<=", date_stop), | |
("paid_by_pos", "=", True), | |
] | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может напрямую по новому полю искать?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может напрямую по новому полю искать?
Действительно можно, но дело в другом. Если какой-то сторонний модуль зависит от этого модуля и использует paid_by_pos, который изначально в базе хранится, то этот сторонний модуль сломается.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может сторонний модуль сделает store=True ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ладно, я устал спорить. Просто обозначу как 10.0.2.0.0 и без store=True.
В стороннем модуле клиента есть функционал печати отчета об операциях в POS сессии. Для добавления возможности вывода в этот отчет произведенные оплаты инвойсов, делаются изменения ниже.