Browse Source

[IMP] contract_price_revision: Improve a bit performance

pull/299/head
Pedro M. Baeza 6 years ago
parent
commit
6ce6a2913e
  1. 4
      contract_price_revision/models/account_analytic_account.py
  2. 1
      contract_price_revision/wizards/create_revision_line_views.xml

4
contract_price_revision/models/account_analytic_account.py

@ -9,7 +9,9 @@ class AccountAnalyticAccount(models.Model):
@api.model @api.model
def _prepare_invoice_line(self, line, invoice_id): def _prepare_invoice_line(self, line, invoice_id):
line_obj = self.env['account.invoice.line'] line_obj = self.env['account.invoice.line']
invoice = self.env['account.invoice'].browse(invoice_id)
invoice = self.env['account.invoice'].browse(
invoice_id, prefetch=self._prefetch,
)
# Line with automatic price are not taken into account # Line with automatic price are not taken into account
if (line.date_start and invoice.date_invoice < line.date_start) or \ if (line.date_start and invoice.date_invoice < line.date_start) or \
(line.date_end and invoice.date_invoice > line.date_end): (line.date_end and invoice.date_invoice > line.date_end):

1
contract_price_revision/wizards/create_revision_line_views.xml

@ -23,7 +23,6 @@
<footer> <footer>
<button string="Apply" name="action_apply" <button string="Apply" name="action_apply"
type="object" class="oe_highlight"/> type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/> <button string="Cancel" class="oe_link" special="cancel"/>
</footer> </footer>
</form> </form>

Loading…
Cancel
Save